Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
这个程序怎么了?为什么我在下面的python代码中遇到运行时错误?_Python - Fatal编程技术网

这个程序怎么了?为什么我在下面的python代码中遇到运行时错误?

这个程序怎么了?为什么我在下面的python代码中遇到运行时错误?,python,Python,最近,我开始解决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

最近,我开始解决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))
信息:

在线法官 凌晨12:40 33分钟前 对我来说

这是UVa在线法官的自动回复

您提交的编号为24507447的问题10071-返回高中物理已收到运行时错误的裁决

这意味着程序的执行没有正确完成。请记住,始终使用退出代码0终止代码

致以最良好的祝愿

UVa在线评委团队

我不明白为什么。本例中需要拆分。没有它,这个程序似乎运行得很好

v=输入 t=输入 d=v*2*t
如果v>=-100和v=0且t.split返回一个列表,该列表无法转换为整数,您能描述一下您在这里想要实现什么吗?因为split将返回列表。为什么要用不同的变量将输入拆分两次?一份清晰的问题陈述将不胜感激。起初,我尝试不使用。拆分。我只尝试了输入功能。但结果是一样的。请记住始终使用退出代码0终止代码。-您是否尝试添加导入系统;系统出口?不,我没试过。我现在就去试试。谢谢