Python在有些时候比c++还是好用多了,比如biginteger和一道校赛题
在这里简单总结一下Python的多组输入方式
1.while(~~~!=EOF)
题目A+B:
由于要一行读入2个数,所以有点细节要注意
while True:
try:
a,b = map(int,input().split())
print(a+b)
except:
break;
2.T组A+B
题目一道校赛题
代码:
n=int(input())
for i in range(n):
m=int(input())
a=int(input())
print(m+a)
如果这题要用c++,由于前导0,确实有点麻烦
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有