题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1002 题目大意: 告诉你两个整数 A,BA,B(它们的位数均不超过 10001000),求它们的和。 解题思路: 高精度加法入门题,直接用数组来模拟。 实现代码如下: #include <bits/stdc++.h> using namespace std; const int maxn = 1010; int T, n, m, a...
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1002 题目意思:就是大整数加法。 两年几前做的,纯粹是整理下来的。 1#include <stdio.h>2#include <string.h>34#definemax 10105chara[max], b[max];67intmain()8{9inti, k, s, c, T, len1, len2;10scanf("%d", &T);11for(k =0; ...
memset(a, 0, sizeof(a)); memset(b, 0, sizeof(b)); for (int i = 0; i < n; i ++) a[i] = s[n-1-i] - '0'; for (int i = 0; i < m; i ++) b[i] = t[m-1-i] - '0'; int len = max(n, m); for (int i = 0; i < len; i ++) { c[i] += a[...
nextInt(); int i = 1; while (i <= t) { BigInteger a = mScanner.nextBigInteger(); BigInteger b = mScanner.nextBigInteger(); System.out.println("Case " + i + ":"); System.out.println(a + " + " + b + " = " + a.add(b).toString()); if (i != t) { System.out.pr...
A + B Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 347161 Accepted Submission(s): 6738...
Problem Description CalculateA + B. Input Each line will contain two integersAandB. Process to end of file. Output For each case, outputA + Bin one line. Sample Input 1 1 Sample Output 2 Author HDOJ 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1000 ...
HDU-1002(C语言)大数加法 A + B Problem II Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 436132 Accepted Submission(s): 84861 Problem Description I have a very simple pro... ...
http://acm.hdu.edu.cn/showproblem.php?pid=1002 Problem Description I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum of A + B. Input The first line of the input contains an integer T(1<=T<=20) which means the number...
HDU 1000: A + B Problem Problem Description Calculate A + B. Input Each line will contain two integers A and B. Process to end of file. Output For each case, output A + B in one line. C: #include<stdio.h>intmain(){inta,b;while(scanf("%d%d",&a,&b)!=EOF)printf("%d\n",...
HDU 1000 A + B Problem(指针版) 简介:A + B Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 654986 Accepted Submission(s): 204210 Problem Description Calculate A + B.