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 |
没错了啊 自我感觉物理学的还可以啊!求求大家了,给个数据吧#include <iostream> #include <cmath> using namespace std; int main() { double k,l,s,w; double v; const double g=9.81; while(cin>>k>>l>>s>>w) { if(w==0) break; if(k==0&&s>l) { cout<<"Stuck in the air."<<endl; continue; } if(s<=l||l==0) { v=sqrt(2*g*s); if(v>10) cout<<"Killed by the impact."; else cout<<"James Bond survives."; cout<<endl; continue; } double G=w*g; double h=(G+sqrt(G*G+2*l*k*G))/k; if(s>l+h) cout<<"Stuck in the air."<<endl; else { double hh=s-l; v=sqrt(2*g*s-k*hh*hh/w); if(v>10) cout<<"Killed by the impact."; else cout<<"James Bond survives."; cout<<endl; } } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator