Блог пользователя joker1569

Автор joker1569, 12 лет назад, По-английски

http://ideone.com/cfqTA0 Could anyone help me to fix this error. java.lang.NullPointerException at Main.Solve(Main.java:18) at Main.Run(Main.java:57) at Main.main(Main.java:12) I dont know why this code have this errors. It running normal and give correct answer on my computer, but when i submited on timus, it is non zero error. This problems in acm.timus.ru is 1297. Sorry for my bad english. Anyway, thanks you for reading.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
12 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

But you submitted it at IdeOne without input data, so input string s is null and yields NPE on getting length.

If you input something (from the sample of Timus, for example) it works:

http://ideone.com/Tgi3fg