c/c++语言开发共享HDUacm 1000 A + B Problem

problem description     calculate a + b. input     each l

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("%dn",a+b);
 9     }
10 }

tips:
    process to end of file.  //使用while循环,终止于eof。
    output a + b in one line.  //printf需输出"/n"。

 

作者 任琦磊

本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。

ctvol管理联系方式QQ:251552304

本文章地址:https://www.ctvol.com/c-cdevelopment/603891.html

(0)
上一篇 2021年5月12日
下一篇 2021年5月12日

精彩推荐