求余数

原题链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=205

 1 #include<iostream>
 2 #include<cstdio>
 3 #include<cstring>
 4 #define mod 10003
 5 using namespace std;
 6 char num[1000005];
 7 int main()
 8 {
 9     int m;
10     scanf("%d",&m);
11     while(m--)
12     {
13         scanf("%s",num);
14         int len=strlen(num),ans=0;
15         for(int i=0;i<len;i++)
16         {
17             ans=(ans*10+num[i]-'0')%mod;
18         }
19         printf("%d\n",ans);
20     }
21     return 0;
22 }
View Code

相关文章:

  • 2021-12-11
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2021-12-08
  • 2022-01-07
  • 2021-09-08
猜你喜欢
  • 2021-06-26
  • 2021-07-12
  • 2021-09-03
  • 2021-08-13
  • 2022-01-31
  • 2021-10-09
相关资源
相似解决方案