标签:
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 5961 Accepted Submission(s): 4167
1 #include <stdio.h> 2 #include <string.h> 3 char str[1010] ; 4 int main() 5 { 6 int i, n ; 7 while(~scanf("%s %d", str, &n)) 8 { 9 int mod = 0 ; 10 int len = strlen(str) ; 11 for(i = 0; i < len; i++) 12 mod = (mod * 10 + str[i] - ‘0‘) % n ; 13 printf("%d\n", mod) ; 14 } 15 return 0 ; 16 }
标签:
原文地址:http://www.cnblogs.com/fengshun/p/4674708.html