A + B Problem
来源:互联网 发布:那年呐服饰淘宝代理可信吗 编辑:程序博客网 时间:2024/04/30 11:36
今天在杭电acm这里做的第一道题 A + B Problem,它的要求是
Problem 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。
这里的Process to end of file. 到底是什么鬼?翻译过来就是一直 处理到文件的结束,或把数据输出到文件的末尾,可这怎么处理啊?纠结了半天才知道,Process to end of file.简单的来说它表示的是输入时从文件读进来的,我们需要一直处理到文件末尾。一般的处理方法是通过while(gets(x))(x是字符串)或者while(scanf("%d",&n)!=EOF)来处理.
代码如下:
#include <stdio.h>int main() { int a,b,c; while(scanf("%d%d",&a,&b)!=EOF) { c=a+b; printf("%d\n",c); //此处n如果删掉就会报错 } return 0;}
1 0
- 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
- 菜单
- codeforces 660B. Seating On Bus
- 【NYOJ】[1092]数字分隔(二)
- Android开发学习总结(一)——搭建最新版本的Android开发环境
- 软件开发公司如何带新人?
- A + B Problem
- 【OpenCV】OpenCV3的第五天——imgproc组件之图像处理
- 4——Service Discovery in a Microservices Architecture
- Linux 内核延时函数
- 【学习笔记】3D图形核心基础精炼版-9:stage3D实战-图片纹理
- HDOJ 1195 Open the Lock
- iptables详解
- linux服务器自动切割并清理日志
- HTTP 常见状态码详解