| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
我这个为什么是WA啊~~~~~ 55555555555555#include "stdio.h"
#include "math.h"
#define pi 3.1415926
double tri[3];
double role,perimeter,halfp;
double area,max,mius;
double R,r;
int counter = 0;
int main()
{
while (1)
{
counter++;
max = 0;
scanf("%lf %lf %lf %lf",tri+0,tri+1,tri+2,&role);
if(*(tri+0) == 0)
break;
perimeter = tri[0]+tri[1]+tri[2];
halfp = perimeter/2;
area = sqrt(halfp*(halfp-tri[0])*(halfp-tri[1])*(halfp-tri[2]));
R = area * 2 / (tri[0]+tri[1]+tri[2]);
if (role == perimeter)
{
max = area;
}
else
{
r = (perimeter - role) / ((perimeter / R) - (2 * pi));
mius = (r*r*perimeter)/(2*R);
max = area - mius + pi * r * r;
}
printf("Case %d: %.2lf\n",counter,max);
}
return 0;
}
Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator