山科日记— A+B Problem (III) : Input/Output Practice

[Submit][Status][Web Board]

Description

计算a+b,0<=a,b<1000。

Input

输入有多对整数a和b组成,每对a和b占一行,a,b用空格分开。当测试样为0 0时表示输入结束,0 0不参与运算。

Output

每行输出一个a+b的值,顺序与输入对应。

Sample Input

1 2
10 20
0 0

Sample Output

3 30

HINT

练习break的使用。

Append Code

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main()
{
    int a, b;
    while(scanf("%d %d", &a, &b)!=EOF)
    {
        if(a==0&&b==0)
        return 0;
        else
        printf("%d
", a+b);
    }
}

  

作者:7oDo

仅供参考,请勿抄袭。

Hang Hang Hang !!!

原文地址:https://www.cnblogs.com/Jie-Fei/p/8295318.html