Problem ID: a-plus-b
Time Limit: 1.0 seconds
Memory Limit: 32.0 MB
Difficulty: Trivial
A + B Problem
Description
Calculate a + b
Input format
The input will consist of a series of pairs of integers a and b,separated by a space, one pair of integers per line.
Output format
For each pair of input integers a and b you should output the sum of a and b in one line,and with one line of output for each line in input.
Input Sample 1
4 5
1 1
-1 0
Output Sample 1
9
2
-1
Hint
Sample Code
C
#include <stdio.h>
int main()
{
int a,b;
while(scanf("%d %d",&a, &b) != EOF)
printf("%d\n",a+b);
return 0;
}
Python 3
#!/usr/bin/env python
import sys
def main():
for line in sys.stdin:
a, b = map(int, line.split())
print(a + b)
if __name__ == '__main__':
main()