Contest4:A+B problem

Problem A: A+B problem

Time Limit: 1 Sec   Memory Limit: 128 MB
Submit: 313   Solved: 213
[ Submit][ Status][ Web Board]

Description

Calculate a+b

Input

There are several lines.

The first line contains the  number of test cases. In the following, each line contains two integer values seperated by  a space.

Output

Output the sum of these values.

Sample Input

3
12345678901 19876543217
54749110547 5474119110
15530259260 130625199010

Sample Output

32222222118
60223229657
146155458270

HINT


These numbers are beyond int types. it will be wrong if you input them directly, so you can use arrays to solve this problem. 



#include <stdio.h>
#include <stdlib.h>
int main()
{   int n,i;
   long long int s;
    scanf("%d",&n);
    long long int x[2*n];
    for(i=0;i<n;i++){
        scanf("\n%lld %lld",&x[2*i],&x[2*i+1]);}
    for(i=0;i<n;i++){
        s=x[2*i]+x[2*i+1];
        printf("%lld\n",s);}
    return 0;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值