武汉科技大学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 ...
随机推荐
- oracle导入
1 建立all.sql脚本,此脚本内容指定了insert脚本的路径all.sql脚本内容如下: @D:\workspace\workspace-二期开始使用的文件\Test\数据库升级工具\导入基础数 ...
- python之路——爬虫实例
urlController.py import bsController from urllib import request class SpiderMain(object): def __init ...
- modelsim遇到的问题(更新)
1.Q:在`timescale处提示错误:** Error: C:\count4\count_tp.v(1): near "'t": Illegal base specifier ...
- Web应用指纹识别
http://danqingdani.blog.163.com/blog/static/186094195201493121834603/
- 利用ordered hints优化SQL
SQL_ID 4g70n3k9bqc5v, child number 0 ------------------------------------- MERGE INTO YJBZH_GRXDFHZ ...
- Merge Two Sorted Lists—LeetCode
Merge two sorted linked lists and return it as a new list. The new list should be made by splicing t ...
- Oracle分页查询与RowNum
1. RowNum伪列 Oracle中,RowNum是一个伪列,表示当前记录是查询结果集中的第几条. RowNum在使用上应该注意,不能在where条件中用RowNum大于.大于等于.等于某个大于1的 ...
- [LeetCode] 310. Minimum Height Trees 解题思路
For a undirected graph with tree characteristics, we can choose any node as the root. The result gra ...
- SpringMVC+SwfUpload进行多文件同时上传
由于最近项目需要做一个多文件同时上传的功能,所以好好的看了一下各种上传工具,感觉uploadify和SwfUpload的功能都比较强大,并且使用起来也很方便.SWFUpload是一个flash和js相 ...
- chrome播放语音时,在chrome 控制台中报 DOMException: The play() request was interrupted by a call to pause(). 的问题.
$(document).ready(function () { var audioElement = $( '<audio>' + ' <source src="" ...