c语言 分数化小数

学习 时间:2026-08-16 06:13:44 阅读:638
c语言 分数化小数

最佳回答

超帅的白猫

彪壮的冥王星

2026-08-16 06:13:44

#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-08-16 06:13:44

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

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

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