acm从基本开始--熟悉输入输出HDU1000 A+B
2015-02-25 23:06
363 查看
A - A + B Problem
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status Practice HDU
1000
Description
Calculate A + B.
Input
Each line will contain two integers A and B. Process to end of file.
Output
For each case, output A + B in one line.
Sample Input
Sample Output
分析:好吧这个题没什么分析的。。(我不会说这篇文章是用来试一试CSDN的博客功能的。。)明白ACM导入测试数据的方式是多组的,这个跟题目叙述有一点关系,具体落实到代码如下:
就是那个while的问题。
此外还有while(scanf("%d%d",a,b)!=EOF),也是可以的,对应的题目表述是"The input of the problem consists several test cases..."
好了就是这样。。
Time Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64u
Submit Status Practice HDU
1000
Description
Calculate A + B.
Input
Each line will contain two integers A and B. Process to end of file.
Output
For each case, output A + B in one line.
Sample Input
1 1
Sample Output
2
分析:好吧这个题没什么分析的。。(我不会说这篇文章是用来试一试CSDN的博客功能的。。)明白ACM导入测试数据的方式是多组的,这个跟题目叙述有一点关系,具体落实到代码如下:
#include <iostream> using namespace std; int main() { int a,b; while(cin>>a>>b) { cout<<a+b<<endl; } }
就是那个while的问题。
此外还有while(scanf("%d%d",a,b)!=EOF),也是可以的,对应的题目表述是"The input of the problem consists several test cases..."
好了就是这样。。
相关文章推荐
- 第一讲 ACM中基本的输入输出
- ACM入门___基本输入输出
- ACM 入门 基本输入输出
- ACM_HDU_1000_A + B Problem
- ACM基本输入输出
- hdu 1000 A + B Problem 简单的输入输出(C、C++)
- 最大子段和 hdu 1003 max sum ACM的开始
- 算法路-HDU-ACM---1000
- ACM基本输入输出(转自http://www.cnblogs.com/chenqiangjsj/archive/2011/04/08/2009452.html)
- 【精】ACM - 【ACM 基本输入输出格式】
- React-Native的基本控件属性方法 对React-Native的学习,从熟悉基本控件开始。
- ACM: 基本得输入输出
- ACM基本输入输出
- 【转】ACM及其他OJ系统基本输入输出规则
- ACM_HDU 1000 A + B Problem
- HDU ACM OJ 1000 1001 1002答案(JAVA)
- ACM基本输入输出
- ACM基本输入输出
- ACM基本输入输出
- 位置子段最大子段和 hdu 1003 max sum ACM的开始