Python学习记录-ZOJ刷题篇 01

作为一个在CSDN潜水了一年多的小白,在之前白嫖了许多大佬们的优秀作品和思路,看他们的文章后自己也获得了不小的进步。于是……在潜水一年多之后,小白终于决定开始自己的学习记录啦!从现在开始我会不定时更新自己平日里学习的记录,记下自己逐步变强(tu)的过程。因为不是科班出身所以基础有些薄弱,如果有幸能被大佬看到,欢迎批评指点!


下面是ZOJ刷题记录(随缘更新)

ZOJ|1001:A+B Problems

题目

A + B Problem
Time Limit: 2000 ms Memory Limit: 65536 KB

原题地址:ZOJ 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

Hint
Use + operator

代码

由于本题较为基础,故不做分析直接贴代码如下:

try:
    while True:
        a, b = map(int, input().split())
        print(a + b)
except EOFError:
    pass

注意事项

本题需要连续输入,在题目中虽并未提及,但实则需要注意这一点。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值