首页 > 学院 > 开发设计 > 正文

A+B (I)

2019-11-10 18:56:30
字体:
来源:转载
供稿:网友

Your task is to Calculate a + b.InputInput contains multiple test cases. Each test case consists of a pair of integers a and b(0<=a,b<=20), separated by a space, one pair of integers per line.OutputFor 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 Input1

1Sample Output

2

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


发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表