作者StarView (星演)
看板java
标题[问题] 用Java写ACM题目,输入的问题
时间Sat Feb 25 12:32:01 2006
最近在练习用Java写程式,就找了一题简单的ACM第476题来解解看.
code如下
http://140.116.5.200/~p7694410/ACM476.txt
答案应该没错,程式submit前我也把public class的public去掉了
,但还是出现compile error
後来看ACM写到submit Java有它的限制:
http://online-judge.uva.es/board/viewtopic.php?t=7429
摘录:
The Java programs submitted must be in a single source code (not .class) file.
Really, they are compiled and run as native applications using the gcj
compiler. They must read and write the standard input/output, as the other
languajes. Note that java::io use is restricted; this implies that some
features (for example, to create a
DataInputStream variable with
System.in as
argument, in order to use readLine to read strings from the standard input)
are
not available.
所以我的code会compile error是因为用System.in及readLine的原故,
我对Java还不是很熟...
想请教一下各位高手我该怎麽修改输入的写法? 才能通过ACM java compiler的考验,
另外想请教ACM的Java compiler:gcj也同步支援到jdk5.0吗?
感谢回答..
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.116.246.39