a = a%b a的值一直没有改变
#include <stdio.h>int main (void)
{
int a,b;
int c[200];
int t_1;
scanf ("%d %d", &a, &b);
for(int i = 0; i<200; i++)
{
t_1 = (a*10)/b;
c[i] = t_1;
a = a % b;
}
printf("0.");
for(int i = 0; i<200; i++)
{
printf("%d", c[i]);
}
return 0;
}
结果:
16 19
0.8888888888888888888888888888888888888888888888888888888888888888888888...