#include<iostream>
#include<math.h>
#include<stdio.h>
using namespace std;
int main()
{
int a,b,c;
float result,res,g,t,m,u,s;
while(cin>>a>>b>>c)
{
if(a>b&&a>c)
result=((float)(a)/(float)(2))*((float)(a)/(float)(2))*3.1416;
else if(b>a&&b>c)
result=((float)(b)/(float)(2))*((float)(b)/(float)(2))*3.1416;
else
result=((float)(c)/(float)(2))*((float)(c)/(float)(2))*3.1416;
s=(float)(a+b+c)/(float)(2);
t=(float)sqrt(s*(s-a)*(s-b)*(s-c));
res=result-t;
if(b>a&&b<c)
g=(float)(b)/(float)(4);
else if(a>b&&a<c)
g=(float)(a)/(float)(4);
else
g=(float)(c)/(float)(4);
m=g*3.1416;
u=t-m;
printf("%.4f %.4f %.4f\n",res,u,m);
}
return 0;
}
#include<math.h>
#include<stdio.h>
using namespace std;
int main()
{
int a,b,c;
float result,res,g,t,m,u,s;
while(cin>>a>>b>>c)
{
if(a>b&&a>c)
result=((float)(a)/(float)(2))*((float)(a)/(float)(2))*3.1416;
else if(b>a&&b>c)
result=((float)(b)/(float)(2))*((float)(b)/(float)(2))*3.1416;
else
result=((float)(c)/(float)(2))*((float)(c)/(float)(2))*3.1416;
s=(float)(a+b+c)/(float)(2);
t=(float)sqrt(s*(s-a)*(s-b)*(s-c));
res=result-t;
if(b>a&&b<c)
g=(float)(b)/(float)(4);
else if(a>b&&a<c)
g=(float)(a)/(float)(4);
else
g=(float)(c)/(float)(4);
m=g*3.1416;
u=t-m;
printf("%.4f %.4f %.4f\n",res,u,m);
}
return 0;
}
No comments:
Post a Comment