Wednesday, December 2, 2015

Uri problem 1002 solve

Problem :

Area of a Circle

Adapted by Neilor Tonin, URI  Brazil
Timelimit: 1
The area of the circle is defined as A = π . R2, having π as 3.14159.
Calculate the area using the formula given in the problem description.

Input

Read the variable R (double precision), that is the radius of the circle.

Output

Print the variable A, rounded to four decimal digits.
Sample InputsSample Outputs
2.00A=12.5664
100.64A=31819.3103
150.00A=70685.7750

Solution:


#include <stdio.h>
  
int main() {
  
double A , R;
    scanf("%lf",&R);
    A=3.14159*(R*R);
    printf("A=%.4lf\n",A);
     
    return 0;
}

No comments:

Post a Comment