设为首页 加入收藏

TOP

HDUacm 1000 A + B Problem
2014-11-24 00:43:40 来源: 作者: 【 】 浏览:81
Tags:HDUacm 1000 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


Code:
1 #include
2 main()
3 {
4 int A,B;
5
6 while(scanf("%d%d",&A,&B)!=EOF)
7 {
8 printf("%d\n",A+B);
9 }
10 }

Tips:
Process to end of file. //使用while循环,终止于EOF。
output A + B in one line. //printf需输出"/n"。

作者 任琦磊
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇HDUacm 1002 A + B Problem II 下一篇C/C++的预编译和宏定义

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: