|
|
вернуться в форум(JAVA) Runs fine in Eclipse but judge says there's a runtime error. HELP! 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! Послано Noob 13 май 2018 13:25 Remove package Re: (JAVA) Runs fine in Eclipse but judge says there's a runtime error. HELP! Послано Mihail 6 июн 2018 00:28 Edited by author 07.06.2018 01:49 |
|
|