3787 A+B 题解

由题意得: 1.由于有逗号的输入,肯定是字符串输入 2.遍历A、B两个字符串,将每个“0~9”的字符转换为整型,存入到sum1和sum2中,最后输出两数之和 3.由于A、B的范围在(-10^9~10^9),所以用int就足够了 4.代码如下: #include<cstdio> #include<cstring> int main() { char str1[20],str2[20];
相关文章
相关标签/搜索