为什么会RE

P1001 A+B Problem

ninji @ 2023-05-25 12:04:11

a=int(input())
b=int(input())
print(a+b)

by Milthm @ 2023-05-25 12:14:07

@ninji 是这样的,python默认是多行读入,但是题目是一行,用空格隔开的。所以不能这么读入。


by yzm0325 @ 2023-05-25 12:37:10

@ninji

a, b = list(map(int, input().split()))[0], list(map(int, input().split()))[1]
print(a + b)

这样应该可以


by yzm0325 @ 2023-05-25 12:38:13

@Zhuyiming0325 不是……还re


by yzm0325 @ 2023-05-25 12:38:57

@Zhuyiming0325

a = list(map(int, input().split(' ')))
print(a[0] + a[1])

AC code.


by GeorgeAAAADHD @ 2023-05-25 13:28:46

@ninji

a=input().split(' ')
print(int(a[0])+int(a[1]))

by ninji @ 2023-05-25 23:21:11

谢谢大家!!!


by SQHN2012 @ 2023-06-12 17:11:36

6


|