当前位置: 移动技术网 > IT编程>开发语言>C/C++ > HDUacm 1000 A + B Problem

HDUacm 1000 A + B Problem

2019年04月19日  | 移动技术网IT编程  | 我要评论

李子京,冷枭你好毒,陈维力

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 <stdio.h>
 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"。

 

作者 任琦磊

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网