A+B Problem
来源:互联网 发布:js 字符串在数组中 编辑:程序博客网 时间:2024/06/07 14:33
Description
calculate A+B
注意测试数据有多组,请以文件结尾作为结束标记(EOF)
Input
A B
Output
A+B的值
Sample Input
1 21 1
Sample Output
32
HINT
标准代码(仅供参考):
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 <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);
}
}
}
- problem 1000: A+B problem
- Problem 1000 A+B Problem
- Problem - 1000 A + B Problem
- A + B Problem
- A + B Problem
- 1000 A+B Problem
- 1001 A + B Problem
- A+B Problem
- 1000 A+B Problem
- A + B Problem
- A + B Problem
- 1000 A + B Problem
- 1000 A+B Problem
- A + B Problem
- A + B Problem II
- A + B Problem II
- POJ1001 -- A-B Problem
- A + B problem II
- 春哥打校赛一 杯具了
- PASSWORD,ENABLE,CONSOLE,VTY及TACACS认证顺序及区别
- 【2012四川省热身赛】Problem A. A - B Problem
- 从零开始学C++之类与对象:类声明、类作用域、前向声明、this指针、嵌套类、PIMPL 技法 等
- Hadoop的Reducer不运行
- A+B Problem
- cxf spring 整合使用示例
- 统计的力量
- 《信号与线性系统分析》 吴大正 (与电子、通信专业的同学共勉)
- Hibernate 使用原生SQL进行查询
- 02-计算字符串的实际长度(字符串处理)
- Tomcat性能调优
- POJ 2492 A Bug's Life
- Tomcat优化配置