while True:
try:
n=int(input())
for i in range(n):
a,b,c=map(int,input().split())
flag=False
for k in range(a+1,b):
if k%c!=0:
print(k,end=" ")
flag=True
if not flag:
print("No free parking spaces.")
except:
break
在自己的電腦上執行,沒發現異狀嗎。
在自己的電腦上執行,沒發現異狀嗎。
題目上那個資測資料都有過
while True:
try:
n=int(input())
for i in range(n):
a,b,c=map(int,input().split())
flag=False
for k in range(a+1,b):
if k%c!=0:
print(k,end=" ")
flag=True
if not flag:
print("No free parking spaces.")
except:
break
要記得換行