| 记录编号 | 233251 | 评测结果 | AAAAAAAAAA | ||
|---|---|---|---|---|---|
| 题目名称 | 2170.大整数取模 | 最终得分 | 100 | ||
| 用户昵称 | 是否通过 | 通过 | |||
| 代码语言 | C++ | 运行时间 | 0.002 s | ||
| 提交时间 | 2016-03-04 12:24:02 | 内存使用 | 0.29 MiB | ||
#include<cstdio>
#include<cstdlib>
#include<cstring>
using namespace std;
const int MAXN=100+10;
char buf[MAXN];
long long m;
int main(){
freopen("bigint.in","r",stdin);
freopen("bigint.out","w",stdout);
scanf("%s%lld",buf,&m);
int len=strlen(buf);
long long ans=0;
for(int i=0;i<len;i++) ans*=10,ans+=buf[i]-'0',ans%=m;
printf("%lld",ans);
}