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

Why is there always COMPILATION ERROR? It was compiled successfully in my local IDE.
Posted by TanyaLew 5 Sep 2016 18:23
I have a hard time submitting my first piece of code. Compilation error appeared and I have no idea why. The following is my code.

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * Created by Tanya on 2016/9/5.
 */
public class ReverseRoot2
{
    Scanner in;
    PrintWriter out;
    public void work()throws Exception
    {
        List<Double> numlist = new ArrayList<Double>();
        in = new Scanner(System.in);
        String line = "";
        while(in.hasNextLine() && !(line = in.nextLine()).equals(""))
        {
            String[] strnums = line.split(" ");
            for(String strnum : strnums)
            {
                if(strnum.matches("[0-9]+\\.*[0-9]*"))
                {
                    numlist.add(Double.parseDouble(strnum));
                }
            }
        }
        out = new PrintWriter(System.out);
        int len = numlist.size();
        for(int i = len - 1;i>=0;i--)
        {
            out.print(Math.sqrt(numlist.get(i).doubleValue()) + "\t");
        }
        out.flush();
    }
    static public void main(String[] args)throws Exception
    {
        ReverseRoot2 rr = new ReverseRoot2();
        rr.work();
    }
}
Re: Why is there always COMPILATION ERROR? It was compiled successfully in my local IDE.
Posted by Oleg Baskakov 5 Sep 2016 20:19
After you submit your code, if it gets "compilation error", within the next 15 minutes it is underlined — you can click on it and see the error message.
Re: Why is there always COMPILATION ERROR? It was compiled successfully in my local IDE.
Posted by ToadMonster 6 Sep 2016 13:10
Facepalm.

Please see your attempts by link
http://acm.timus.ru/status.aspx?space=1&num=1001&author=211233

What language your program is? What language you submitted?