Blue Bridge Cup: Introductory training round area "Java algorithm implementation"

Source: Internet
Author: User

Title 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


Sample output


Data size and conventions

1 <= R <= 10000.

Import Java.text.decimalformat;import Java.util.scanner;public class Main {public static void main (string[] args) { Scanner cin = new Scanner (;d ouble pi=3.14159265358979323;double n=cin.nextint ();d ouble s=n*n*pi;d Ecimalformat df = new DecimalFormat ("###.0000000"); System.out.println (Df.format (s));}}

Blue Bridge Cup: Introductory training round area "Java algorithm implementation"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.