HDU1.1.1 A+B for Input-Output Practice (I)

来源:互联网 发布:手机触摸屏控制软件 编辑:程序博客网 时间:2024/06/07 16:31

就是简单的整数相加,当没有输入的时候退出。

很早以前就是通过这题知道了用scanf()!=EOF来检验是否还有输入

#include <cstdio>using namespace std;int main(){int a,b;while(scanf("%d%d",&a,&b)!=EOF){printf("%d\n",a+b);}return 0; } 


0 0
原创粉丝点击