#46717: python不會LTE方法


mikevin77@cloud.ssvs.tp.edu.tw (張家銘)


import sys

while True:
    k = int(sys.stdin.readline())

程式碼前段如上

必須要用此法取代input
#46718: Re: python不會LTE方法


mikevin77@cloud.ssvs.tp.edu.tw (張家銘)


 
import sys

while True:
    k = int(sys.stdin.readline())

程式碼前段如上

必須要用此法取代input

然後VSCode測試時,需要自建一個文字檔(如input.txt),把測資放進去

 

測試程式不能用Start Debugging(F5),而是在Triminal輸入

Get-Content input.txt | python Q11498.py

Q111498.py和input.txt兩個檔案必須放在同一個目錄下