OJ-Problems-Source/HDOJ/1212_autoAC.cpp

19 lines
304 B
C++
Raw Normal View History

2016-08-13 17:16:08 +08:00
#include<stdio.h>
#include<string.h>
int main()
{
int n,i,t;
char a[1010];
while(scanf("%s%d",&a,&n)!=EOF)
{
t=0;
for(i=0;i<strlen(a);i++)
{
t=t*10+a[i]-'0';
t%=n;
}
printf("%d\n",t);
}
return 0;
}