明天是第一次参加互联网大厂笔试机考,所以练习一下牛客网上ACM模式的常见输入和输出,防止明天出岔子
A+B(1)
while True:
try:
a,b = map(int,input().split())
print(a+b)
except:
break
A+B(2)
while True:
try:
t = int(input())
for _ in range(t):
a,b = map(int, input().split())
print(a+b)
except:
break
A+B(3)
while True:
try:
a,b = map(int, input().split())
if a!=0 and b!=0:
print(a+b)
except:
break
A+B(4)
while True:
try:
lst = list(map(int, input().split()))
if lst[0]==0:
break
else:
print(sum(lst[1:]))
except:
break
A+B(5)
while True:
try:
t = int(input())
for _ in range(t):
lst = list(map(int,input().split()))
print(sum(lst[1:]))
except:
break
A+B(6)
while True:
try:
lst = list(map(int, input().split()))
print(sum(lst[1:]))
except:
break
A+B(7)
while True:
try:
lst = list(map(int,input().split()))
print(sum(lst[:]))
except:
break
字符串排序(1)
while True:
try:
n = int(input())
lst = list(input().split())
a = sorted(lst)
print(" ".join(a))
except:
break
字符串排序(2)
while True:
try:
lst = list(input().split())
a = sorted(lst)
print(" ".join(a))
except:
break
字符串排序(3)
while True:
try:
lst = list(input().split(","))
a = sorted(lst)
print(",".join(a))
except:
break