3577 - AcmPC2015 - 101 - First Problem
时间限制 : 1 秒
内存限制 : 128 MB
Calculate a + b
题目输入
The input will consist of a series of pairs of integers a and b,separated by a space, one pair of integers per line.
题目输出
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.
输入/输出样例
输入格式
1 5
输出格式
6
C语言解答
#include "stdio.h" int main() { int a,b; while(scanf("%d %d",&a,&b)!=EOF) { printf("%d\n",a+b); } return 0; }
C++解答
#include <fstream> using namespace std; int main(int argc, char* argv[]) { int a,b; while(scanf("%d%d",&a,&b)!=EOF){ printf("%d\n",a+b); } return 0; }