|
|
back to boardHow to input it (Java)? I tried with Scanner and BufferedReader, but have no luck :( Help???? Re: How to input it (Java)? Posted by akoskm 14 Apr 2009 04:54 So... how to input it in Java? Re: How to input it (Java)? Thanks for support, but no one answers!!!! :D Ask Donny, he knows the answer!!!! Re: How to input it (Java)? Posted by donny 20 Apr 2009 02:15 In this problem you need to parse the string, so I think you need to do it char by char. I used BufferedReader.readLine, and then parsed the aquired string... I tried using a StringReader created out of the string, and then used it's read() method to get chars out of it, but you could also read the chars directly from the string (charAt(int)), or you could dump it into an char array. The first test is the sample test (I'm pretty sure). Note that -0.051 gets printed as 0.0 withouth a minus sign in front. Re: How to input it (Java)? Look at first http://acm.timus.ru/help.aspx?topic=javaScanner in = new Scanner(System.in); And use method of this object,(for example) int x = in.nextInt(); long x = in.nextLong(); String st = in.nextLine(); and etc. |
|
|