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:1: error: class, interface, or enum expected
Posted by Denis_D 26 Sep 2015 01:03
Задача не принималась с ошибкой java:1: error: class, interface, or enum expected при прикреплении файла. Когда отправил то же самое в виде текста - все принялось. С чем это может быть связано? Текст задачи следующий:

import java.io.*;
import java.util.*;

public class SQ2 {


    public static void main(String[] args) throws Exception {
        // TODO Auto-generated method stub
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        double[] al = new double[131072];
        int i = 0;
        while(in.hasNextDouble()){
            al[i++] = in.nextDouble();
        }

        for(;i>0;i--){
            long i1 = (long)Math.round(Math.sqrt(al[i-1])*10000);
            out.format("%.4f%n",(double)i1/10000);
        }
        out.flush();
        in.close();

    }

}