|
|
back to board( JAVA ), My Code is Running Fine ( See it through for reference ) - Reverse Root import java.util.*; public class ReverseRoot { public static void main(String[] args) { ArrayList<Long> list = new ArrayList<>(); Scanner scn = new Scanner(System.in); while (scn.hasNextLong()) { long p = scn.nextLong(); list.add(p); } scn.close(); for (int i = list.size() - 1; i >= 0; i--) { System.out.printf("%.4f%n", Math.sqrt((double) list.get(i))); } } } Re: ( JAVA ), My Code is Running Fine ( See it through for reference ) - Reverse Root Edited by author 17.02.2021 15:27 Re: ( JAVA ), My Code is Running Fine ( See it through for reference ) - Reverse Root Scanner scn = new Scanner(System.in); long p; String line; while (!(line = scn.nextLine()).trim().equals("")) { p = Long.parseLong(line); list.add(p); } |
|
|