#include <stdio.h>
#include <math.h>
int main(void) {
int i, book = 1, j, t;
int num[200];
long a, b, c;
scanf("%ld%ld", &a, &b);
if (a + b < 0)
book = 0;
c = abs(a + b);
i = t = 0;
if (!c) {
printf("0");
return 0;
}
while (c != 0) {
num[i] = c % 10;
i++;
c /= 10;
}
if (!book)
printf("-");
for (j = i - 1; j >= 0; j--) {
printf("%d", num[j]);
t++;
if (t % 3 == i % 3 && t != i)
printf(",");
}
return 0;
}
1001 A+B Format
最新推荐文章于 2022-08-09 22:11:11 发布