HDUacm 1000 A + B Problem
程序员文章站
2023-10-24 17:07:22
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("%d\n",a+b);
9 }
10 }
tips:
process to end of file. //使用while循环,终止于eof。
output a + b in one line. //printf需输出"/n"。
作者 任琦磊
上一篇: Linux下 Sendmail服务器 转发功能的讲解
下一篇: 如何汉化Linux 2