|
|
back to boardwhere have i gone wrong? it works fine on my computer to end the loop i have to press ctrl+z import java.util.*; public class ReverseRoot { static int[] a=new int[1]; static int i=-1; static int[] b; public static void main(String[] args) { Scanner key=new Scanner(System.in); while(key.hasNext()) { i++; if(i>a.length-1) resize(a.length+1); a[i]=key.nextInt(); } for(int s=a.length-1;s>=0;s--) System.out.println(Math.sqrt(a[s])); } public static void resize(int size) { b=new int[size]; for(int s=0;s<a.length;s++) b[s]=a[s]; a=b; } } |
|
|