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

参考代码

Posted by wsy217 at 2009-04-12 14:20:34 on Problem 2463
#include<stdio.h>
#include<math.h>
#define g 9.81
int main()
{
	double m,h,l,k;
	double v;
	while(scanf("%lf%lf%lf%lf",&k,&l,&h,&m))
	{
		if(!k && !l && !h && !m)
			return 0;
		if(l>=h)
		{
			v=sqrt((double)h*2*g);
			if(v<=10)
			{
				printf("James Bond survives.\n");
			}
			else	
				printf("Killed by the impact.\n");
			continue;
		}
		else if(l<h)
		{
			if(k/2*(h-l)*(h-l)>m*g*h)
			{
				printf("Stuck in the air.\n");
				continue;
			}
			v=sqrt(2.0*g*h-k*(h-l)*(h-l)/m);
				if(v<=10)
				{
					printf("James Bond survives.\n");
				}
				else	
					printf("Killed by the impact.\n");
			continue;
		}
	}
	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