A+B for Input-Output Practice (I)

Your task is to Calculate a + b.
Too easy?! Of course! I specially designed the problem for acm beginners.
You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim.
Input
The input will consist of a series of pairs of integers a and b, separated by a space, one pair of integers per line.
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
Sample Output
6
30
问题来源:https://vjudge.net/problem/HDU-1089
问题分析:。。。简单
代码:分别输入a,b,然后输出a+b。
AC通过的代码如下:

#include<iostream>
using namespace std;
int main()
{
    int a, b;
    while (cin >> a >> b)
        cout << a + b << endl;
}
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,505评论 0 10
  • 一、Elementary系统概述 Elementary OS作为Ubuntu的扩展分之,号称是最美的Linux发行...
    肆不肆傻阅读 25,178评论 8 24
  • 馨月做完手术,得知靳远醒过来的消息,连忙赶过来,看见少阳正傻呵呵笑着看向重症室,馨月也探头向重症室里面看,正看到靳...
    其乐融融_6231阅读 2,057评论 14 13
  • 别抱怨谁令你寒心, 要多想想令你寒心的人给过你多少温暖! ​​​
    再凑热闹阅读 260评论 0 0
  • 文字/摄影:若木菡 昨天,市摄影家协会第六期培训班,在师生热烈的掌声中恋恋不舍地结业了。 历时三个半月,弹指一瞬间...
    若木菡阅读 624评论 26 23