#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = ~0u >> 2; //1073741823
const ll INF = ~0ull >> 2; //4611686018427387903
const int maxn = 1e3 + 10;
int main()
{
//Solution s = Solution();
int a, b;
scanf("%d%d", &a, &b);
a = a + b;
//cout << a << endl;
if (a < 0)
{
printf("-");
a = -a;
}
int t = 0;
string ans;
while(1)
{
ans += char('0' + a % 10);
//cout << ans << endl;
a /= 10;
if(a==0){
break;
}
t++;
if(t==3){
t = 0;
ans += ',';
}
}
for (int i = ans.size() - 1; i >= 0;i--)
printf("%c", ans[i]);
return 0;
}
PAT甲级1001_A+B Format _模拟
最新推荐文章于 2022-03-14 18:34:21 发布