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)的更多相关文章

  1. 武汉科技大学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 ...

  2. 武汉科技大学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 ...

  3. 武汉科技大学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 ...

  4. 武汉科技大学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 ...

  5. 武汉科技大学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 ...

  6. 武汉科技大学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 ...

  7. 武汉科技大学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 ...

  8. 武汉科技大学ACM:1006: 我是老大

    Problem Description 今年是2021年,正值武汉科技大学 ACM俱乐部成立10周年.十周年庆祝那天,从ACM俱乐部走出去的各路牛人欢聚一堂,其乐融融.庆祝晚会上,大家纷纷向俱乐部伸出 ...

  9. 武汉科技大学ACM:1005: Soapbear and Honey

    Problem Description Soapbear is the mascot of WHUACM team. Like other bears, Soapbear loves honey ve ...

随机推荐

  1. js-ajax实现获取xmlHttp对象

    //获取xmlHttp对象 function createXMLHttp() { var xmlhttp; //对于大多数浏览器适用 if (window.XMLHttpRequest) { xmlh ...

  2. 【转】(DT系列四)驱动加载中, 如何取得device tree中的属性

    原文网址:http://www.cnblogs.com/biglucky/p/4057488.html 本文以At91rm9200平台为例,从源码实现的角度来分析驱动加载时,Device tree的属 ...

  3. 4. c++ 静态 对象

    参考自文章:http://blog.csdn.net/wpf_ml/article/details/7763534 1. 静态存储 变量定义在函数外或是用static 关键字修饰的变量存放在静态存储区 ...

  4. openstack theme topic

  5. 糟糠之妻下堂,娇俏公主上位——更换宝马三系座椅作业 - 切诺基 Jeep家族 越野e族论坛 越野/SUV/旅行/赛事/改装/互动中心

    糟糠之妻下堂,娇俏公主上位--更换宝马三系座椅作业 - 切诺基 Jeep家族 越野e族论坛 越野/SUV/旅行/赛事/改装/互动中心 舒适性没有想象中好.我觉得理想的座椅,应该象是在你最疲倦的时候,把 ...

  6. 比较了一下基于PhoneGAP/JQ Mobile 等基于HTML5的Phone 开发框架

    比较了一下基于PhoneGAP/JQ Mobile 等基于HTML5的Phone 开发框架,如果做APP客户端的化,想达到Native UI的效果,都是胡扯的,根本不可能. PhoneGAP 如果想达 ...

  7. 程序中使用7-zip(7z)压缩文件

    Email:longsu2010 at yeah dot net 工作中难免遇到需要压缩文件的情况,比如有一千万个小文件,每个文件约100k,如果使用7-zip压缩后可能十几k,可以节省很多磁盘空间. ...

  8. 如何将HashMap,按照value值排序

    这里要用到一个Comparator的接口,里面只有一个方法,compare(),我们实现这个接口就好,很简单 private class ValueComparator implements Comp ...

  9. SQL报错error:索引中丢失IN或OUT參数

    简单记录下: 今天mybatis中遇到一个错误: org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallba ...

  10. linux mysql 数据目录文件夹移动及所遇到的问题

    一 .如果是fedora下用rpm包安装的mysql,修改方法如下: 如果这里说的不够清楚,可以到http://www.vipkj.net/post-839.html给我留言 MySQL默认的数据文件 ...