#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll mod(char str[],ll c)
{
ll number[20000];
for(int i=0; i<strlen(str); i++)
number[i]=str[i]-'0';
ll sum=0;
for(int i=0; i<strlen(str); i++) //大数取模就是按照每一位取模,不断重复
{
sum=((ll)sum*10+number[i])%c;
}
return sum;
}
int main()
{
char s[20000];
while(cin>>s)
{
ll n;
cin>>n;
cout<<mod(s,n)<<endl;
}
}
05-20
05-20
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交