关闭

A + B Problem

752人阅读 评论(0) 收藏 举报

Problem

Calculate a + b

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

Sample Output

6

Hint

Use + operator

Solution:

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

 

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:297153次
    • 积分:2452
    • 等级:
    • 排名:第15062名
    • 原创:41篇
    • 转载:18篇
    • 译文:8篇
    • 评论:74条