武汉科技大学ACM :1001: A+B for Input-Output Practice (I)
Problem Description
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
#include<iostream>
#include<string>
using namespace std;
int main()
{
int a,b;
int sum;
string result;
char s[];
while(cin>>a>>b)
{
if(a == && b == )
break;
sum = a+b;
sprintf(s, "%d",sum);
result += s;
result += "\n";
}
cout<<result;
return ;
}
武汉科技大学ACM :1001: A+B for Input-Output Practice (I)的更多相关文章
- 武汉科技大学ACM :1008: A+B for Input-Output Practice (VIII)
Problem Description Your task is to calculate the sum of some integers. Input Input contains an inte ...
- 武汉科技大学ACM :1007: A+B for Input-Output Practice (VII)
Problem Description Your task is to Calculate a + b. Input The input will consist of a series of pai ...
- 武汉科技大学ACM :1006: A+B for Input-Output Practice (VI)
Problem Description Your task is to calculate the sum of some integers. Input Input contains multipl ...
- 武汉科技大学ACM :1005: A+B for Input-Output Practice (V)
Problem Description Your task is to calculate the sum of some integers. Input Input contains an inte ...
- 武汉科技大学ACM :1004: A+B for Input-Output Practice (IV)
Problem Description Your task is to Calculate the sum of some integers. Input Input contains multipl ...
- 武汉科技大学ACM :1003: A+B for Input-Output Practice (III)
Problem Description Your task is to Calculate a + b. Input Input contains multiple test cases. Each ...
- 武汉科技大学ACM :1002: A+B for Input-Output Practice (II)
Problem Description Your task is to Calculate a + b. Input Input contains an integer N in the first ...
- 武汉科技大学ACM:1006: 我是老大
Problem Description 今年是2021年,正值武汉科技大学 ACM俱乐部成立10周年.十周年庆祝那天,从ACM俱乐部走出去的各路牛人欢聚一堂,其乐融融.庆祝晚会上,大家纷纷向俱乐部伸出 ...
- 武汉科技大学ACM:1005: Soapbear and Honey
Problem Description Soapbear is the mascot of WHUACM team. Like other bears, Soapbear loves honey ve ...
随机推荐
- 构建高可用web站点学习(一)
单个服务器如何处理请求 web服务器最简单的形式就是一个程序,它侦听HTTP请求,在收到一个HTTP请求之后做出回复.当然在接收请求后服务器所做的东西是我们关注的焦点.在下文中也会提及到node是如何 ...
- 科通芯城:用B2C的方式做B2B
上线两年,科通芯城的年收入有望突破50亿,一个传统分销商用2c的方式做b2b,也能进行自我革命. 文 | 王海天 这个网站的名字叫科通芯城,于2011年下半年在深圳正式上线,卖的商品是IC元器件,包括 ...
- 最小费用最大流MCMF zkw费用流
稀疏图慢死了...但是稠密图效果还是很好的 struct MCMF{ struct tedge{int x,y,cap,w,next;}adj[maxm];int ms,fch[maxn]; int ...
- typedef 用法及 指针函数 和 函数指针
typedef 本质上是定义了一种新的类型, 该新类型可以原有类型的别名或是原有类型的组合. 而#define 只是字符串的替换. 如定义: typedef char* CHARP; 则 CHARP ...
- 我是企业号体验账户 我发送消息:微信错误 errcode=60011,
http://qydev.weixin.qq.com/qa/index.php?qa=3197&qa_1=%E6%88%91%E6%98%AF%E4%BC%81%E4%B8%9A%E5%8F% ...
- Java学习日记-2.5 关于0和无穷
1. 无穷 Java中将无穷定义为浮点数,分为正负无穷,分别为POSITIVE_INFINITY和NEGATIVE_INFINITY 2. null null在java中可以理解为一个特殊的引用类型, ...
- HDOJ 2102
如果传送门'#'的另一层是传送门'#'或者是墙'*',就可以理解为这两层的这个位置都是'*'了 还有就是传送门'#'传过去可以是空地'.' 也可以是目的地'P',不要忽略了 #include < ...
- Appium 环境搭建
1.安装nodejs 下载地址: http://nodejs.org/download/ 下载之后一路next就好. 验证是否安装成功: node -v
- Spring MVC之LocaleResolver(解析用户区域)
为了让web应用程序支持国际化,必须识别每个用户的首选区域,并根据这个区域显示内容. 在Spring MVC应用程序中,用户的区域是通过区域解析器来识别的,它必须实现LocaleResolver接口. ...
- 关于Web Api的HelpPage文档注释问题
之前使用Microsoft.AspNet.WebApi.HelpPage的时候,一直为返回对象的注释发愁,以为这是个BUG. 这个注释的解决办法其实要从其原理理解就明白了. 因为HelpPage是读取 ...