关闭

hdoj A+B for Input-Output Practice (III)

144人阅读 评论(0) 收藏 举报
分类:

Problem Description

Your task is to Calculate a + b.

Input

Input contains multiple test cases. Each test case contains a pair of integers a and b, one pair of integers per line. A test case containing 0 0 terminates the input and this test case is not to be processed.

Output

For each pair of input integers a and b you should output the sum of a and b in one line, and with one line of output for each line in input.

Sample Input

1 5
10 20
0 0

Sample Output

6
30
代码:
#include<stdio.h>
int main()
{
       int a,b;
       while(scanf("%d%d",&a,&b)&&a||b)
       {
           printf("%d\n",a+b);
       }
   return 0; 
}
注意:&&a||b的意思
0
0
查看评论

HDU_ACM_A+B for Input-Output Practice (III)

如果有啥不正确或不合适的地方 希望能在评论里面指出
  • qq_20141243
  • qq_20141243
  • 2016-03-26 23:54
  • 122

「HD_ACM」A+B for Input-Output Practice (III)

Problem Description Your task is to Calculate a + b. ->你的任务是计算A +B   Input Input contains multiple test cases. Each test case contains a ...
  • Simple_Bottle
  • Simple_Bottle
  • 2015-05-01 22:56
  • 970

山东理工大学ACM平台题答案关于C语言 1012 A+B for Input-Output Practice (III)

A+B for Input-Output Practice (III) Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目描述 Your task is to Calculate ...
  • u012707729
  • u012707729
  • 2013-12-13 20:56
  • 959

HDU1089-HDU1096 A+B for Input-Output Practice (I)-(VIII)(入门必备训练)

这若干个程序是输入输出的基本模式,需要烂熟于心。 首先给出测试用程序。这是每一个OJ都会有的测试程序,可以用来走一个流程体会一下。 后8个程序是有关输入输出练习,是入门必备。这些几乎涵盖了所有输入输出的基本模式。 问题链接:HDU1000 A + B Problem Problem ...
  • tigerisland45
  • tigerisland45
  • 2017-05-15 11:43
  • 3116

[水题][hdoj_1096]A+B for Input-Output Practice (VIII)

// hdoj_1096 A+B for Input-Output Practice (VIII) #include int main(void) { int n, m, a, sum, i, j; scanf("%d", &n); for(i = 0; ...
  • litiouslove
  • litiouslove
  • 2012-07-31 01:42
  • 3348

[水题][hdoj_1094]A+B for Input-Output Practice (VI)

// hdoj_1094 A+B for Input-Output Practice (VI) #include int main(void) { int n, a, sum, i; while(scanf("%d", &n) != EOF) { sum =...
  • litiouslove
  • litiouslove
  • 2012-07-31 01:20
  • 2410

hdoj A+B for Input-Output Practice (V)

Problem Description Your task is to calculate the sum of some integers. Input Input contains an integer N in the first line, and then N lines fol...
  • zhaihao1996
  • zhaihao1996
  • 2015-11-20 18:13
  • 271

「HD_ACM」A+B for Input-Output Practice (VII)

Problem Description Your task is to Calculate a + b. ->你的任务是计算A + B   Input The input will consist of a series of ...
  • Simple_Bottle
  • Simple_Bottle
  • 2015-05-02 21:59
  • 1780

杭电ACM 1089 A+B for Input-Output Practice (I)

A+B for Input-Output Practice (I) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission...
  • neuxxm
  • neuxxm
  • 2012-11-12 00:54
  • 1728

「HD_ACM」A+B for Input-Output Practice (IV)

Problem Description Your task is to Calculate the sum of some integers. ->你的任务是计算一些整数相加   Input Input contains multiple...
  • Simple_Bottle
  • Simple_Bottle
  • 2015-05-02 21:26
  • 934
    个人资料
    • 访问:39366次
    • 积分:2786
    • 等级:
    • 排名:第15173名
    • 原创:248篇
    • 转载:13篇
    • 译文:0篇
    • 评论:4条