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

Java. Wrong answer. Test 2.
Posted by Daniil 18 Feb 2015 17:38
import java.io.*;
import java.lang.*;
import java.util.*;

public class MathSqrt
{
    public static void main(String[] args) throws Exception
    {
        Scanner sc = new Scanner(System.in);
        double[] array = new double[4];

        for(int i = 0; i < array.length; i++)
        {
            array[i] = sc.nextDouble();
        }

        for(int i = array.length - 1; i >= 0 ; i--)
        {
            double b = Math.sqrt(array[i]);
            System.out.println(b);
        }

    }
}

Edited by author 18.02.2015 17:39

Edited by author 18.02.2015 17:39
Re: Java. Wrong answer. Test 2.
Posted by Leoltron 6 Mar 2015 20:40
Why length of your array is 4? It's acceptable to the first test, but there is not a certain amount of numbers in the task.