![](/img/trans.png)
[英]What am I doing wrong, in following Python program, as I'm getting global queue empty?
[英]What's wrong with this program? Why I getting runtime error in my following python code?
最近開始用UVA在線判斷解決一個問題。 但提交此程序后,它顯示以下消息:“運行時錯誤”。
v = int(input().split())
t = int(input().split())
d = v * (2*t)
if (v >= -100 and v <= 100) and (t >= 0 and t <= 200):
print(str(d))
我也試過這個代碼。 但結果是一樣的。
v = int(input())
t = int(input())
d = v * (2*t)
if (v >= -100 and v <= 100) and (t >= 0 and t <= 200):
print(str(d))
信息:
UVa Online Judge 12:40 AM(33 分鍾前)給我
你好,
這是來自 UVa Online Judge 的自動回復。
您提交的編號為 24507447 的問題 10071 - Back to High School Physics 已收到判定 Runtime Error。
這意味着您的程序沒有正確執行。 請記住始終使用退出代碼 0 終止您的代碼。
此致,
UVa 在線裁判團隊
我不明白為什么在這個例子中需要.split()
。 沒有它,程序似乎運行良好
v = int(input())
t = int(input())
d = v * (2*t)
if (v >= -100 and v <= 100) and (t >= 0 and t <= 200):
print(str(d))
編輯:最終的打印語句也可以只是print(d)
,沒有理由將其轉換為字符串
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.