# stdin 像是 while readline()
# 会自动结束程序 (在acwing 1295)
for x in stdin:
# do something
# 如果用stdin.readline()必须手动判断是否结束
while True:
x = stdin.readline().strip('\n')
if not x: break
Python stdin 和 stdin.readline()
于 2022-02-27 21:42:54 首次发布