码迷,mamicode.com
首页 > 其他好文 > 详细

A+B 7

时间:2020-01-31 12:17:47      阅读:57      评论:0      收藏:0      [点我收藏+]

标签:std   ios   任务   end   mes   output   stream   int   换行符   

你的任务是计算a+b。Input

输入由一系列成对的由空格分割的整数a和b构成,一对输入占用一行。

Output

对于每组输入,要求在一行输出它们的和。并且你要保证每组输出之间有一空行。

Sample Input

1 5
10 20

Sample Output

6

30
 

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

 

注意一下需要两个换行符就行了了

A+B 7

标签:std   ios   任务   end   mes   output   stream   int   换行符   

原文地址:https://www.cnblogs.com/heroin1/p/12244751.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!