📄 2463.txt
字号:
Memory:36K Time:0MS
Language:C++ Result:Accepted
Source
#include"iostream.h"
#include"math.h"
double k,l,s,w;
const double g=9.81;
bool init()
{
cin>>k>>l>>s>>w;
return !(k==0&&l==0&&s==0&&w==0);
}
int calculate()
{
double v,v0,h,vv;
if(s<=l||k==0)
{
v=sqrt(2*s*g);
if(v>10)return -1;
else return 1;
}
else
{
v0=sqrt(2*l*g);
h=(2*w*g+sqrt(4*w*w*g*g+8*k*w*g*l))/(2*k);
h+=l;
if(h<s)return 0;
vv=(2*w*g*s-k*(s-l)*(s-l))/w;
if(vv<0)while(1)cout<<"faint"<<endl;
v=sqrt(vv);
if(v>10)return -1;
else return 1;
}
}
int main()
{
while(init())
{
switch(calculate())
{
case 1:cout<<"James Bond survives."<<endl;break;
case 0:cout<<"Stuck in the air."<<endl;break;
case -1:cout<<"Killed by the impact."<<endl;break;
}
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -