您的位置:首页 > 其它

hdu 5832 A water problem(大数取模)

2016-08-15 17:28 561 查看
题目链接

思路:大数取模,73*137=10001,所以对10001取模

代码

#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<map>
#include<queue>
#define LL long long
using namespace std;
const int N=10000005;
char s
;
int main()
{
int n=1;
while(~scanf("%s",s))
{
int len=strlen(s);
LL sum=0;
for(int i=0;i<len;i++)
{
sum=(sum*10+s[i]-'0')%10001;
}
if(sum==0)
{
printf("Case #%d: YES\n",n++);
}
else
{
printf("Case #%d: NO\n",n++);
}
}
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: