while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
run = int(input())
main(run)
except EOFError:
break
except EOFError:
break
except EOFError:
break
except EOFError:
break
except EOFError:
break
#暴力應付換行
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
run = int(input())
main(run)
except EOFError:
break
except EOFError:
break
except EOFError:
break
except EOFError:
break
except EOFError:
break
#暴力應付換行
給你一個更好的寫法:
stdin.read().splitlines()
給你一個更好的寫法:
stdin.read().splitlines()
謝謝,我下次用用,不過不知道是故意還是不小心的,測資有奇怪的換行
stdin.read().split()
抱歉我說錯了應該是這樣
有些時候很多亂換行真的會讓人很討厭,哈哈,我也卡很久才看到討論區說需要分隔
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
run = int(input())
main(run)
except EOFError:
break
except EOFError:
break
except EOFError:
break
except EOFError:
break
except EOFError:
break
#暴力應付換行
我是用函數加迴圈
def inp():
while True:
s = input()
if s != '':
return s
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
while 1:
try:
run = int(input())
main(run)
except ValueError:
run = int(input())
main(run)
except EOFError:
break
except EOFError:
break
except EOFError:
break
except EOFError:
break
except EOFError:
break
#暴力應付換行我是用函數加迴圈
def inp():
while True:
s = input()
if s != '':
return s
同樣的問題又來嘍