记录编号 |
279983 |
评测结果 |
AAAAAAAAAA |
题目名称 |
大整数取模 |
最终得分 |
100 |
用户昵称 |
Hzoi_chairman |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.002 s |
提交时间 |
2016-07-09 19:34:34 |
内存使用 |
0.31 MiB |
显示代码纯文本
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int read()
{
char ch;
int x,f=1;
while(ch=getchar(),!isdigit(ch))if(ch=='-')f=-1;
x=ch-48;
while(ch=getchar(),isdigit(ch))x=x*10+ch-48;
return x*f;
}
int main()
{
freopen("bigint.in","r",stdin);
freopen("bigint.out","w",stdout);
string s;
cin>>s;
int len=s.size();
int m=read(),ans=0;
for(int i=0;i<len;i++)
{
ans=(int)(((long long)ans*10+s[i]-48)%m);
}
cout<<ans;
fclose(stdin);
fclose(stdout);
return 0;
}