mirror of
https://github.com/xlucn/PAT.git
synced 2026-10-03 00:23:15 +08:00
21 lines
357 B
C
21 lines
357 B
C
#include <stdio.h>
|
|
#include <string.h>
|
|
|
|
int main()
|
|
{
|
|
int a, b, pos;
|
|
char num[11];
|
|
|
|
scanf("%d%d", &a, &b);
|
|
sprintf(num, "%d", a + b);
|
|
|
|
for(pos = strlen(num) - 3; pos > 0 && num[pos - 1] != '-'; pos -= 3)
|
|
{
|
|
memmove(num + pos + 1, num + pos, strlen(num) - pos + 1);
|
|
num[pos] = ',';
|
|
}
|
|
|
|
puts(num);
|
|
return 0;
|
|
}
|