2 3 12 7 152455856554521 3250
2 5 1521
//============================================================================
// Name : Math_hdu1212.cpp
// Author : vit
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int mod(char *a,int b)//模拟手算
{
int tmp=0;
int len=strlen(a);
for(int i=0; i<len; i++)
{
tmp=tmp*10+a[i]-‘0‘;
tmp=tmp%b;
}
return tmp;
}
char a[1001];
int main() {
int b;
while(cin >> a >> b){
cout << mod(a , b) << endl;
}
return 0;
}
hdu1212 Big Number,布布扣,bubuko.com
原文:http://blog.csdn.net/svitter/article/details/22998641