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) Runs fine in Eclipse but judge says there's a runtime error. HELP!
Posted by Kenny Castro-Monroy 7 May 2018 22:14
package timusreverseroot;

import java.text.DecimalFormat;
import java.util.*;
public class TimusReverseRoot {

    public static void main(String[] args) {
        DecimalFormat f = new DecimalFormat("#0.0000");
        Scanner keyboard = new Scanner(System.in);
        String inputs = keyboard.nextLine();
        String[] parsed = inputs.split(" ");

        for (String parsed1 : parsed) {
            int square = (int) Math.pow(Integer.parseInt(parsed1), 2);
            System.out.println(f.format(square));
        }
    }

}
I added in the package line but if I left that in, it would give me a compilation error, why is that? And this code runs perfectly fine in Netbeans but the judge gives a compilation error

Edited by author 07.05.2018 22:48

Edited by author 07.05.2018 22:49
Re: (JAVA) Runs fine in Eclipse but judge says there's a runtime error. HELP!
Posted by Noob 13 May 2018 13:25
Remove package
Re: (JAVA) Runs fine in Eclipse but judge says there's a runtime error. HELP!
Posted by Mihail 6 Jun 2018 00:28


Edited by author 07.06.2018 01:49