3n+1 challenge at UVa

旧城冷巷雨未停 提交于 2019-12-06 08:58:57

Solved. OK, for starters the site http://programming-challenges.com definitely is not working right now for Java submissions (they're doing some kind of server migration now). I tried the alternate site http://uva.onlinejudge.org ; that one is processing Java submissions correctly.

But anyway, I had a bug in my code above - this line fixes it:

String[] data = line.trim().split("\\s+");

The input data will always be messy - extra spaces, empty lines, etc. and anyone trying to parse the input should assume this.

dekdev

Home>Online Judge > submission Specifications

this link might help

Sample code to read input is from : http://online-judge.uva.es/problemset/data/p100.java.html

here is one more link for stackoverflow : https://stackoverflow.com/a/14632770/1060656

I think the most important thing in UVA judge is 1) Get the output Exactly same , No Extra Lines at the end . 2) I am assuming , Never throw exception just return or break with No output for Outside boundary parameters. 3)Output is case sensitive 4)Output Parameters should Maintain Space as shown in problem

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!