时间限制:1秒 空间限制:32768K
题目描述
给定两个整数A和B,其表示形式是:从个位开始,每三位数用逗号","隔开。 现在请计算A+B的结果,并以正常形式输出。
输入描述: 输入包含多组数据数据,每组数据占一行,由两个整数A和B组成(-10^9 < A,B < 10^9)。
输出描述: 请计算A+B的结果,并以正常形式输出,每组数据占一行。
输入例子: -234,567,890 123,456,789
1,234 2,345,678
输出例子: -111111101
2346912
思路:输入两个串,然后将其中每一个串都变成数字(忽略逗号诶)
代码:
#include <iostream> #include <string.h> using namespace std; char str1[15],str2[15]; int main(){ string a,b; int numa,numb; while(cin>>a>>b){ memset(str1,'