1287 - A+B
时间限制 : 1 秒
内存限制 : 64 MB
print the sum of two integer
题目输入
two integer a and b
题目输出
the sum of a and b
输入/输出样例
输入格式
1 2
输出格式
3
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; }
Java解答
import java.util.*; public class Main{ public static void main(String args[]){ Scanner cin = new Scanner(System.in); int a, b; while (cin.hasNext()){ a = cin.nextInt(); b = cin.nextInt(); System.out.println(a + b); } } }