ACM(four)

作者: 九九询 | 来源:发表于2018-12-06 23:24 被阅读0次

A + B Problem

Calculate A + B.

Inpout

Each line will contain two integers A and B. Process to end of file.

Output

For each case, output A + B in one line.

Examples

Sample Input
1 1
Sample Output
2

问题简述

两数求和。

程序分析

此程序需注意可输入的不止一次a,b。因此,可用while循环语句,使得每一次输入过程中,计算出相应的和。

AC程序如下:

//hdu-1000
#include<iostream>
using namespace std;
int main()
{
    int a, b;
    while (cin >> a >> b)
        cout << a + b << endl;
    return 0;
}

相关文章

网友评论

      本文标题:ACM(four)

      本文链接:https://www.haomeiwen.com/subject/frtzcqtx.html