ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1074. Very Short Problem

How to input it (Java)?
Posted by Mitrev Misa 10 Apr 2009 00:38
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)?
Posted by Mitrev Misa 14 Apr 2009 12:33
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)?
Posted by Oleg Strekalovsky [Vologda SPU] 21 Apr 2009 00:43
Look at first http://acm.timus.ru/help.aspx?topic=java
Scanner 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.