习题 3-8 循环小数(Repeating Decimals,ACM/ICPC World Finals 1990,Uva 202)
/**思路:1)打表,记录1-1990的小数*2)寻找其周期*/#include#includeintmain(){inta,b,i=0;chars[2000];scanf("%d%d",&a,&b);printf("%d.(",a/b);while(1){s[i++]=a*10/b+'0';a=a*10%b;if(i>1990)break;}intl=strlen(s);intk;for(k=1