1287 - A+B

print the sum of two integer

题目输入

two integer a and b

题目输出

the sum of a and b

输入/输出样例

题目输入

1 2

题目输出

3

提示

use scanf and printf in stdio.h

C语言解答

#include<stdio.h>
#include "string.h"
#include<stdlib.h>

int main(){
	int a,b;
	while(scanf("%d%d",&a,&b)!=EOF)
		printf("%d\n",a+b);

	return 0;
}

C++解答

#include <iostream>
using namespace std;
int main(){
    int a,b;
    while(cin >> a >> b)
        cout << a+b << endl;
	return 0;
}

提示

use scanf and printf in stdio.h

时间限制 1 秒
内存限制 64 MB
讨论 统计
上一题 下一题