Import Java.text.DecimalFormat;
Import Java.util.Scanner;
public class Theareaofcircle {
public static void Main (string[] args) {
/* Problem description
The radius of the given circle R, to find the area of the circle.
Input format
The input contains an integer r that represents the radius of the circle.
Output format
The output line, containing a real number, rounded to retain 7 digits after the decimal point, indicating the area of the circle.
Description: In the subject, the input is an integer, but the output is a real number.
For the real output of the problem, please be sure to see the real output of the requirements, such as the need to retain the decimal point 7, your program must be strictly output 7 decimal places, output too much or too little number of decimal places are not, will be considered wrong.
The problem with the real output if not specifically stated, rounding is done by rounding.
Sample input
4
Sample output
50.2654825
Data size and conventions
1 <= R <= 10000. */
Scanner sc=new Scanner (system.in);
int r=sc.nextint ();;
while (r<1|r>10000) {
R=sc.nextint ();
}
DecimalFormat DF =new DecimalFormat ("# # #0.0000000");
Double Circle=r*r*math.pi;
Double B=math.round (circle*10000000)/10000000.0000000;
System.out.println (b);
System.out.println (Df.format (circle));
}
}
Java area for rounding