样例输入:
1 6 4
0 0 0
样例输出:
Case 1: 0.1667
#include<stdio.h>#include<math.h>
int main(){
__int64 a,b;
int c,kase=0;
while(scanf("%I64d %I64d %d",&a,&b,&c) == 3 && !( a == 0 && b == 0 && c == 0)){
kase++;
int t1=a/b;
double t2=(double)a/(double)b-(double)t1;
int t3=(int)(t2*pow(10,c)+0.5);
printf("Case %I64d:%I64d.%I64d\n",kase,t1,t3);
}
return 0;
}
结果: