大数取模问题。题目传送门:HDU1212
#include <iostream>
using namespace std; char a[1010]; int main()
{
int b;
while (cin >> a>> b)
{
int flag = 0;
for (int i = 0; a[i] != '\0'; i++)
flag = ((flag * 10) % b+ (a[i] - '0') %b) % b;
cout << flag << endl;
}
return 0;
}