#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
using namespace std;
int mod(char *a,int num)//模板
{
int len = strlen(a);
int number[2000];
for(int i = 0 ; i< len ; i++)
{
number[i] = a[i] - '0';
}
int remain = 0;
for(int i = 0 ; i< len ; i++)
{
remain = ((long long )remain*10 +number[i])%num;
}
return remain;
}
int main()
{
char a[10005];
int m;
while(cin>>a>>m)
{
cout<<mod(a,m)<<endl;
}
return 0;
}
hdu1212(大数取模)
最新推荐文章于 2021-03-17 07:49:06 发布