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 1001. Reverse Root

I USED JAVA LANGUAGE.WRONG ANSWER IN SECOND CASE???help me,pls!
Posted by bahasdu 9 May 2011 20:51
This is my code.
import java.util.*;
public class Main {
    public static void main(String args []){
        Scanner in = new Scanner(System.in);
        double list[]=new double[4];
        double a;
        for(int i=0;i<=3;i++){
            a=in.nextDouble();
            a=Math.sqrt(a);
            list[i]=a;
        }
        for(int j=3;j>=0;j--){
            String text = String.format("%.4f",list[j]).replace(',', '.');
            System.out.println(text);
        }
    }
}
It works correctly on my computer. But if I pass it there will be error in second case.

Edited by author 09.05.2011 20:54

Edited by author 09.05.2011 20:55

Edited by author 09.05.2011 20:55
Re: I USED JAVA LANGUAGE.WRONG ANSWER IN SECOND CASE???help me,pls!
Posted by AterLux 9 May 2011 21:10
Imagine, that second test contain more than 4 values ;)