Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
Register

## Re:我这个为什么是WA啊(好像少考虑了一种情况，仅供参考）

Posted by hujk2008 at 2004-10-19 21:01:13 on Problem 1927
In Reply To:我这个为什么是WA啊~~~~~ 55555555555555 Posted by:chris2007_1984 at 2004-10-18 21:49:28
```#include<iostream>
#include<math.h>
#include<iomanip>

using namespace std;
const double PI=(2.0*asin(1.0));

int main(void)
{
double x,y,z,role,half,max;
double R,r,triple,area;
int hujk=1;
cin>>x>>y>>z>>role;
while(x+y+z+role)
{
triple=x+y+z;
half=triple*0.5;
area=sqrt(half*(half-x)*(half-y)*(half-z));
R=area*2.0/triple;
if(x+y+z<=role)
max=area;
else if(2.0*PI*R>=role)
max=role*role/(4.0*PI);
else
{
r=(triple-role)/(triple/R-2.0*PI);
max=area+PI*r*r-(r*r*area/(R*R));
}
cout<<"Case "<<hujk++<<": ";
cout<<setiosflags(ios::fixed)<<setprecision(2)<<max<<endl;
cin>>x>>y>>z>>role;
}
return 0;
}
```

Followed by: