在python中提交UVa时总是会出现运行时错误

时间:2016-11-15 12:44:05

标签: python onlinejudge

DECLARE
   LNBUF   VARCHAR2 (4000) ;
BEGIN
  --Your loop starts
 Loop
   LNBUF   := NULL ;

   SELECT (   CAST ('LT01' AS CHAR (8))
           || CAST (REC.WN_COUNTRY AS CHAR (3))
           || CAST (rec.WN_NORMSSNR_WW AS CHAR (32))
           || CAST (REC.WN_SOFTWARE AS CHAR (7))
           || CAST (REC.WN_NORMSSNR AS CHAR (32))
           || RPAD (' ', 32, ' ')
           || CAST (REC.WN_NAME_WW AS CHAR (16))
           || CAST (REC.WN_NAME AS CHAR (16))
           || CAST (REC.WN_NORMBYTE AS CHAR (6))
           || CAST ('0' AS CHAR (3))
           || CAST ('ST' AS CHAR (2))
           || RPAD (' ', 70, ' ')
           || CAST ('ST' AS CHAR (3))
           || RPAD (' ', 60, ' ')
           || TO_CHAR (rec.WN_FOD, 'YYYYMMDD')
           || TO_CHAR (rec.WN_LOD, 'YYYYMMDD'))
     INTO lnbuf
     FROM t_wn_ctab_str rec
    WHERE rec.wn_ctab_id = 1234;

   dbms_output_put_line (lnbuf);
 End Loop ;
END;

大家好,很抱歉,如果我提出一些多余的问题,但我不明白为什么这段代码在Uva中出现运行时错误。 这是UVa中一个非常简单的问题 11547 - 自动回答

我们在Uva有提交格式吗?实际上我已经完成了6个问题,但是我对所有问题都有运行错误,我想这是输入问题

1 个答案:

答案 0 :(得分:1)

这里有很多可能出错的东西,int(input())或str(n)[ - 2],... 你应该让你的代码更具防御性。此外,Python3中未定义xrange,因此您需要确保使用Python2。