HDUOJ5832A water problem&&2016中国大学生程序设计竞赛 - 网络选拔赛1001

来源:互联网 发布:to the moon 音乐 知乎 编辑:程序博客网 时间:2024/05/25 05:37

竟然只是用数组模拟大数然后做取模运算,自己还是太菜,做题太少。

#include<cstdio>#include<cstring>#include<cstdlib>#include<cstdlib>#include<algorithm>#include<stack>using namespace std;char a[10000050];int main(){int j=1;while(~scanf("%s",a)){int len=strlen(a),mod=0;for(int i=0;i<len;i++)mod=(mod*10+(a[i]-'0')%10001)%10001;if(mod==0)printf("Case #%d: YES\n",j++);elseprintf("Case #%d: NO\n",j++);}}


0 0