Problem Description

Your task is to Calculate a + b.

Input

Input contains an integer N in the first line, and then N lines follow. Each line consists of a pair 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

2
1 5
10 20

Sample Output

6
30
 #include<iostream>
#include<string>
using namespace std;
int main()
{
int n,a,b;
int sum;
string result;
char s[];
cin>>n;
for(int i=;i<n;i++)
{
cin>>a;
cin>>b;
sum = a+b;
sprintf(s, "%d",sum);//将整数转为字符串型
result += s;
result += "\n";
}
cout<<result;
return ;
}

武汉科技大学ACM :1002: A+B for Input-Output Practice (II)的更多相关文章

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

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

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

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

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

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

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

  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 ...

  10. 武汉科技大学ACM:1002: 华科版C语言程序设计教程(第二版)例题6.6

    Problem Description 明天就要英语考试了,小明明正在挑灯夜 战背单词.小明明发现单词很难背,背一个忘一个.经过仔细研究,小明明发现单词难背的原因是因为某个字符的出现,破坏了整个单词的 ...

随机推荐

  1. 一个jpa动态模糊查询的实现

    最近一直在是用spring data jpa,使用起来确实方便,如果是单表的操作基本上通过方法名都可以实现,下面是一个 Specification 实现动态模糊查询的例子这个查询是通过JpaSpeci ...

  2. codevs 2152 滑雪

    2152 滑雪  时间限制: 1 s  空间限制: 32000 KB  题目等级 : 黄金 Gold 题解       题目描述 Description trs喜欢滑雪.他来到了一个滑雪场,这个滑雪场 ...

  3. new Random().nextInt

    public static void main(String[] args) { System.out.println(new Random().nextInt(0)); } Exception in ...

  4. POJPower Network (最大流)

    题目链接. 分析: 这题描述的可不是一般的复杂. 其时就是很多源点.很多汇点,使尽量多流量的到达汇点. 因为有很多源点,就再设一个源点(0号),使得0号到其它源点的容量为其它源点的初始量,同样设一汇点 ...

  5. 【转】Android Activity和Intent机制学习笔记----不错

    原文网址:http://www.cnblogs.com/feisky/archive/2010/01/16/1649081.html Activity Android中,Activity是所有程序的根 ...

  6. 【搬运】一分钟快速入门OpenStack

      一.它是什么,能干什么   想认识一个事物,必须先弄明白它是什么,能干什么.   首先说一下,openstack是一个搭建云平台的一个解决方案,说他不是个软件,但是我觉得说是一个软件,能够让初学者 ...

  7. 【转】TCP三次握手过程

    写的非常明白:http://www.cnblogs.com/rootq/articles/1377355.html TCP协议三次握手过程分析 TCP(Transmission Control Pro ...

  8. 用python爬虫抓站的一些技巧总结

    1. [代码]最基本的抓站     ? 1 2 import urllib2 content = urllib2.urlopen('http://XXXX').read() 2. [代码]使用代理服务 ...

  9. [Java Concurrent] 多线程合作 producer-consumers / queue 的简单案例

    在多线程环境下,通过 BlockingQueue,实现生产者-消费者场景. Toast 被生产和消费的对象. ToastQueue 继承了 LinkedblockingQueue ,用于中间存储 To ...

  10. banana pro 板子

    http://www.lemaker.org/cn/article-23-1.html