天天看點

nyoj 求餘數

http://acm.nyist.net/JudgeOnline/problem.php?pid=205

View Code

1 #include<stdio.h>
 2 #include<string.h>
 3 int main()
 4 {
 5     long long  t;
 6     int len;
 7     char str[1000010];
 8     scanf("%lld",&t);
 9     while(t--)
10     {
11         long long  yushu=0;
12         scanf("%s",str);
13         len=strlen(str);
14         for(int i=0;i<len;i++)
15         {
16             yushu=yushu*10+str[i]-'0';
17             yushu=yushu%10003;
18         }
19         printf("%lld\n",yushu);
20     }
21 }      

轉載于:https://www.cnblogs.com/1114250779boke/archive/2012/08/24/2654787.html