#include<iostream>
#include<string>
using namespace std;
int main(){
int a, b, c;
scanf("%d %d", &a, &b);
c = a + b;
if(c < 0){
c = -1 * c;
printf("-");
}
string str1 = to_string(c);
string str2 = "";
for(int i = str1.size()-1, j = 0; i >= 0; --i, ++j){
if(j % 3 == 0 && j != 0) str2 = ',' + str2;
str2 = str1[i] + str2;
}
cout << str2 << endl;
return 0;
}
博客围绕PAT甲级1001 A+B Format题目展开,虽暂无具体内容,但可知是关于该题目的相关探讨,此题目分值为20分。
323

被折叠的 条评论
为什么被折叠?



