HDU--1212大数取模

大数取模问题。题目传送门: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] != ''; i++)
            flag = ((flag * 10) % b+ (a[i] - '0') %b) % b;
        cout << flag << endl;
    }
    return 0;
}


原文地址:https://www.cnblogs.com/Tovi/p/6194859.html