使用python在uva中提交代码时出现运行时错误

时间:2016-07-14 21:15:27

标签: python-3.x onlinejudge

这是我的问题编号623(500!)

的代码
SQL> with tbl(val, formula) as (
     select 12, '*24/100'   from dual union
     select 8,  '*12*24/10' from dual
   )
   select xmlquery(replace( val || formula, '/', ' div ')
          returning content).getNumberVal() as result
   from tbl;

    RESULT
----------
     230.4
      2.88

SQL>

它在uva判决中给出了运行时错误,但在pc上运行正常

1 个答案:

答案 0 :(得分:2)

input()导致EOFError。做

try:
    n=input()
except EOFError:
    break

而不是

n=input()
if not n:
    break