标签:精确 div include code ret 小数 can clu ble
/*输入正整数a,b,c,输出a/b的小数形式,精确到小数点后c位。a,b<=10^6,c<=100。
输入包含多组数据,结束标记为a=b=c=0。
样例输入:
1 6 4
0 0 0
样例输出:
case 1:0.1667
*/
1 #include<stdio.h> 2 int main() 3 { 4 int a,b,c; 5 while(scanf("%d%d%d",&a,&b,&c)!=EOF) 6 { 7 if(a==0&&b==0&&c==0) 8 return 0; 9 else 10 printf("%.*f\n",c,(double)a/b); 11 } 12 return 0; 13 }
标签:精确 div include code ret 小数 can clu ble
原文地址:https://www.cnblogs.com/kkkkmio/p/12295835.html