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 Runtime error in Java?
Posted by Azizbek 22 Oct 2020 22:08
import java.util.Scanner;
import java.math.RoundingMode;
import java.text.DecimalFormat;
public class Misol1001{
public static void main(String[]args){
Scanner i=new Scanner(System.in);
DecimalFormat df = new DecimalFormat("#.####");
        df.setRoundingMode(RoundingMode.CEILING);
int a=i.nextInt();
long[] k=new long[a];
for(int j=0; j<a; j++){
k[j]=i.nextLong();
}

double[] l=new double[a];
for(int c=0;c<a; c++){
l[c]=Math.sqrt(k[c]);
}
for(int j=a-1; j>=0; j--){

System.out.println(df.format(l[j]));
}
}
}