HDU 1000 A + B Problem
2016-07-16 20:46
357 查看
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 1Sample Output
2这是一道水题,很简单的。但是要注意输入的是多行,要用到while(scanf(“%d%d”,&a,&b)!=EOF)这一条语句
#include <iostream> #include <stdio.h> using namespace std; int main() { int a, b; int sum; while(scanf("%d%d",&a,&b)!=EOF) { sum=0; sum=a+b; printf("%d\n",sum); } return 0; }
结果
相关文章推荐
- 我的作品 电子元件替换速查字典V5.0(32位)
- linux安装svn服务端
- 判断一棵二叉树是否为完全二叉树
- [C-C++]控制台用定时器
- iPhone的home键进果汁了,按起来粘粘的感觉
- 修改Eclipse neon的project explorer 下的项目名称字体设置
- 自动化运维工具Ansible详细部署
- [置顶] 求一元二次方程的解:
- MySql简单入门一
- python字符操作函数总结
- Android getColor方法提示过时
- 神奇的 echo 命令
- mongodb聚合
- windows环境下如何安装memcached教程
- Using file redirection
- java的继承和多态
- Linux进程监控工具:Supervisor
- 如何修改Matlab默认启动目录?
- POJ1625 Censored!
- MySQL基于gtid特性与xtrabackup的数据恢复