UESTC 1014 Shot

这题刚开始没想通,结果发现要解方程,代码如下:

 

UESTC 1014 Shot
UESTC 1014 Shot
#include<iostream>   
#include<cstdio>   
#include<cmath>   
#include<cstring>   
#include<algorithm>   
#include<cstdlib>   
#include<string>   
#include<map>   
#include<vector>   
#include<set>   
#include<numeric>   
#define mod 1007   
#define INT 2147483647   
#define pi 3.141592654   
//freopen("1.txt","r",stdin);   
using namespace std;   
  
int main()     
{     
    double h,l,v;     
    double alpha;     
    double max=0;  //yaojia h      
    double height;     
    while(scanf("%lf%lf%lf",&h,&l,&v))     
    {     
        if(h==0&&l==0&&v==0)   
            break;   
        double kk=(v*v)/(9.8*l);   
        double cita=atan(kk);   
        double tt = l/(cos(cita)*v);   
        double res = (v*sin(cita)*tt)-((9.8/2)*tt*tt);   
        printf("%.2f\n",res+h);     
    }     
    return 0;     
}     
View Code

 

Database error: [Table 'ac_search_cache' is marked as crashed and should be repaired]

SELECT * FROM ac_search_cache WHERE hash = '3c53d806fa6d283e010e161f1df248583df69556' LIMIT 1;