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

我这个为什么是WA啊~~~~~ 55555555555555

Posted by chris2007_1984 at 2004-10-18 21:49:28 on Problem 1927
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator