A program for finding the results of a+b and a-b.

Time Limit: 1000/2000 MS (C/Others)   Memory Limit: 65536/512 K (C/Others)

Input:
There are multiple sets of data, each time entering two numbers, a and b, separated by spaces, one pair of integers per line. (|a|,|b|<=2^62), |a|, |b| denote the absolute value of a, b.

Output:
For each pair of integers a and b, you should output the answers for a+b and a-b on one line, separated by spaces.


Sample Input:
1 2
3 3
Sample Output:
3 -1

Source code:

#include<stdio.h>

#include<math.h>
int main(void){
int a, b, result1, result2;
        while(scanf("%d %d", &a, &b)!=EOF){
result1 = a + b;
result2 = a - b;
if(fabs(a) < 2^62 & fabs(b) < 2^62){
printf("%d %d", result1, result2);
}
}
return 0;
}

Comments