【发布时间】:2019-01-01 12:08:05
【问题描述】:
def aplusb(a, b):
return a+b
# write your code here
q=0
max=int(raw_input())
while q<max :
a,b = map(int, raw_input().split())
q=q+1
# q=aplusb(a,b)*q
for q in range(max):
q = aplusb(a, b)
print q
if __name__ == "__main__":
q = int(raw_input())
for i in range(q):
inps = [int(_) for _ in raw_input().split()]
print aplusb(inps[0], inps[1])
当我输入(2,1) 和(3,6) 等两个不同系列的数字时,我希望得到类似(3) \N (9) 的结果,但它们现在已经显示(9) /n (9)!我该如何解决?
【问题讨论】:
-
你能澄清一下你的代码应该做什么吗?
-
取一个数字作为您的系列的计数(例如,如果您输入 3,则意味着您要放置 3 个系列的数字,因为每个系列包含两个数字,它们之间有空格),然后添加(3 系列) 他们并向您展示结果(三个结果)
标签: python function output add