HDU1212】的更多相关文章

大数取模问题.题目传送门: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 <…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1212 题意:给出两个数a, b,求a%b: 思路:(c+d)%e=c%e+d%e,(c*d)%e=(c%e*d%e)%e: 代码: #include <iostream> #include <stdio.h> #include <string.h> #define ll long long #define MAXN 1000+10 using namespace std;…
大数MOD #include<cstdio> #include<cstdlib> #include<iostream> #include<algorithm> #include<memory.h> #include<cstring> #include<string> using namespace std; string s; long long Mod; int main() { int i; while(cin>…
Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 9006    Accepted Submission(s): 6100 Problem Description As we know, Big Number is always troublesome. But it's really important in ou…
本题大意:给出一个1000位以内的大数和一个小数,让你计算并给出大数对小数取余的结果. 本题思路:由下面的公式可以推出本题的计算公式,套入即可解决,建议自己把这个公式推一下,很简单的... 参考代码: #include <cstdio> #include <cstring> using namespace std; + ; int b, len, ans; char a[maxn]; int main () { while(~scanf("%s %d", a,…
大数MOD #include<cstdio> #include<cstdlib> #include<iostream> #include<algorithm> #include<memory.h> #include<cstring> #include<string> using namespace std; string s; long long Mod; int main() { int i; while(cin>…
Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4594    Accepted Submission(s): 3175 Problem Description As we know, Big Number is always troublesome. But it's really important in ou…
POJ题目分类 | POJ题目分类 | HDU题目分类 | ZOJ题目分类 | SOJ题目分类 | HOJ题目分类 | FOJ题目分类 | 模拟题: POJ1006 POJ1008 POJ1013 POJ1016 POJ1017 POJ1169 POJ1298 POJ1326 POJ1350 POJ1363 POJ1676 POJ1786 POJ1791 POJ1835 POJ1970 POJ2317 POJ2325 POJ2390 POJ1012 POJ1082 POJ1099 POJ1114…