#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
string toString(int num){
if(num == 0) return string("0");
string s;
int flag = 0;
while(num){
s = char(num % 10 + '0') + s;
num /= 10;
++flag;
if(flag == 3 && num){
flag = 0;
s = "," + s;
}
}
return s;
}
int main()
{
int a, b;
scanf("%d%d", &a, &b);
int sum = a + b;
int flag = 0;
if(sum < 0) printf("-");
string s = toString(abs(sum));
printf("%s", s.c_str());
return 0;
}
1001. A+B Format (20)
最新推荐文章于 2021-02-19 15:05:15 发布