Calculate a + b and output the sum in standard format -- that is, the digits must be separated into groups of three by commas (unless there are less than four digits).
Input
Each input file contains one test case. Each case contains a pair of integers a and b where -1000000 <= a, b <= 1000000. The numbers are separated by a space.
Output
For each test case, you should output the sum of a and b in one line. The sum must be written in the standard format.
Sample Input
-1000000 9
Sample Output
-999,991
1 #include<cstdio> 2 #include<iostream> 3 #include<string.h> 4 using namespace std; 5 int main(){ 6 int a, b, c, sign = 0, bt; 7 char prt[30]; 8 scanf("%d%d", &a, &b); 9 c = a + b; 10 if(c < 0){ 11 c = -1 * c; 12 sign =1; 13 } 14 int i = 0, tag = 0; 15 do{ 16 bt = c % 10; 17 c = c / 10; 18 prt[i++] = '0' + bt; 19 tag++; 20 if(tag != 0 && tag % 3 == 0){ 21 prt[i++] = ','; 22 } 23 }while(c != 0); 24 if(prt[i - 1] != ',') 25 prt[i] = '