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

Wrong answer please help me
Posted by Axmadjon 14 Apr 2014 12:28
import java.io.*;
import java.text.DecimalFormat;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        List<Double> a = new ArrayList<Double>();
        while (in.hasNextDouble() ) {
            a.add(in.nextDouble());
        }

        DecimalFormat df = new DecimalFormat("#.0000");
        for (int i = a.size() - 1; i >= 0; --i) {
            out.println(df.format(Math.sqrt(a.get(i))));
        }
    }
}