ECNU-ACM-Problem A+B(Big Integer)

Description

Give two positive integer A and B,calucate A+B.
Notice that A,B is no more than 500 digits.

Input

The test case contain several lines.Each line contains two positive integer A and B.

Output

For each input line,output a line contain A+B

Sample Input

2 3
1231231231823192 123123123123123
1000000000000000 1  

Sample Output

5
1354354354946315
1000000000000001

------------------------------------------------------------------------------------------------

Source Code  :

Problems:

1、忘了把字符串要进行转置。

2、在写转 置函数的时候,没有写正确

在for 循环中,少了&& i < ( l- 1 - i )  , 导致会出现问题。实际上,在要进行交换的时候,应该是要交换的前一个的索引要比后一个小才进行,所以要加上这个条件。

3、少了对于a[i] = '/0' ;的处理。

应该加上如下代码:

否则,在

a = 1 ;

b = 9999 ;

会出现问题。

编程水平下降了,唉!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值