c语言 分数化小数

学习 时间:2026-06-04 05:31:34 阅读:2910
c语言 分数化小数

最佳回答

闪闪的大树

知性的毛衣

2026-06-04 05:31:34

#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-06-04 05:31:34

    #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);}

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

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