ural 1243 Divorce of the seven dwarfs
http://acm.timus.ru/problem.aspx?space=1&num=1243
对7取模,数据规模10^50
#include <stdio.h>
#define MAXLEN 55
char in[MAXLEN];
int main()
{
while(scanf("%s",in)!=EOF)
{
int ans=0,i;
for(i=0;in[i];i++)
ans = ( 10*ans + in[i]-'0' ) % 7;
printf("%d\n",ans%7);
}
return 0;
}
浙公网安备 33010602011771号