UVa 10868 - Bungee Jumping(物理公式) 发表于 2015-08-30 | 分类于 AOAPC II , Chapter 10. Maths | 中学物理知识推推公式就能出来,没什么好说的了。123456789101112131415161718#include<cstdio>#include<cmath>using namespace std;const double g=9.81;int main(){ double k,l,s,m; while(~scanf("%lf%lf%lf%lf",&k,&l,&s,&m)&&(k||l||s||m)){ double dtl=(m*g+sqrt(m*m*g*g+2.0*k*l*m*g))/k; if(s>l+dtl) puts("Stuck in the air."); else{ double v=2.0*g*s; if(s>l) v-=k*(s-l)*(s-l)/m; if(v<=100.0) puts("James Bond survives."); else puts("Killed by the impact."); } } return 0;}本文迁移自我的 CSDN博客 ,格式可能有所偏差。