ZOJ 1001 A + B Problem

 大家好,本篇内容讲解的是ZOJ ACM竞赛的编号为1001的题目

原题如下:

Calculate a + b

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

Sample Output

6

 //摘自ZOJ (pintia.cn)

翻译结果:

计算 a + b

输入

输入将由一系列整数对a和b组成,由空格分隔,每行一对整数。

输出

对于每对输入整数 a 和 b,您应该在一行中输出 a 和 b 的总和,并为输入中的每行输出一行输出。

示例输入

1 5

示例输出

6

 以下为我写的代码:

#include<stdio.h>
int main(void)
{
    int a, b;
    while (scanf("%d%d", &a, &b) != EOF) printf("%d\n", a + b);
    return 0;
}

非常简单,就不过多解释了

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

洋洋得意呀

您的鼓励是我最大的动力,谢谢您

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值