标签:
#include <stdio.h> #include <string.h> #define MAXN 1000005 char s[MAXN]; int main () { int t; scanf("%d",&t); while(t--) { getchar(); int mod; scanf("%d",&mod); scanf("%s",s); int len = strlen(s); int ans = 0; for(int i=0; i<len; i++) ans = (ans*10 + (s[i]-‘0‘))%mod; printf("%d\n",ans); } return 0; }
标签:
原文地址:http://www.cnblogs.com/TreeDream/p/5789631.html