Skip to content

Commit cac2611

Browse files
Add files via upload
1 parent 5455ef1 commit cac2611

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#include <cstdio>
2+
3+
void semi_circle_area(double circumference)
4+
{
5+
const double PI = 3.1415926;
6+
7+
double area = (circumference*circumference)/(2*PI);
8+
printf("%.2lf\n", area);
9+
}
10+
11+
int main()
12+
{
13+
while(true)
14+
{
15+
double circumference;
16+
scanf("%lf", &circumference);
17+
18+
if(circumference == 0) break;
19+
20+
semi_circle_area(circumference);
21+
}
22+
23+
return 0;
24+
}

0 commit comments

Comments
 (0)