c语言 分数化小数

学习 时间:2026-04-02 06:46:16 阅读:1381
c语言 分数化小数

最佳回答

从容的星星

饱满的蜡烛

2026-04-02 06:46:16

#include "stdio。h"
#include "stdlib。h"
int main()
{
 int a,b,c;
 scanf("%d%d%d",&a,&b,&c);
 if(b==0 || c<0)
 {
  printf("Input error!Stop!\n");
  exit(0);
 }
 printf("%。*lf\n",c,a*1。0/b);
}

最新回答共有2条回答

  • 喜悦的钢笔
    回复
    2026-04-02 06:46:16

    #include "stdio。h"#include "stdlib。h"int main(){ int a,b,c; scanf("%d%d%d",&a,&b,&c); if(b==0 || c<0) {  printf("Input error!Stop!\n");  exit(0); } printf("%。*lf\n",c,a*1。0/b);}

上一篇 哪一个是正确的瑞典语?会一点瑞典语的就可以

下一篇 高压锅锅盖漏气怎么办