hdu6373 物理题 8.9也是xiaolver菜的像狗的一天

http://acm.hdu.edu.cn/showproblem.php?pid=6373 题目大概是说有一块板,求 球能在板上弹几次.

乍一看,好麻烦啊,然后做的时候你会发现,其实真的很麻烦.....

和做高中物理题一样

看成g分解为沿斜面和垂直鞋面的部分计算.高中物理就经常错在时间上,要记住你算的时间是一次的,弹起来在落下是两倍的时间!

#include <iostream>
#include <string>
#include <cstring>
#include <stdio.h>
#include <math.h>
#include <iomanip>
#include <map>
#define sd(qwe) scanf("%d",&qwe)
#define se(cvb) scanf("%lf",&cvb)
#define ss(asd) scanf("%s",asd)
#define sc(xcv) scanf("%c",&xcv)
#define xh(ert,rty,tyu) for(int ert=rty;ert<=tyu;ert++)
#define fxh(u,i,o) for(int u=i;u>=o;u--)

using namespace std;
int main()
{int k;sd(k);
    while(k--)
    {double a,b,c,d,g=9.8;se(a);se(b);se(c);se(d);c=-c;
     double ax=sin(atan(b/a))*g;
     double y=(d-c*b/a);double yt=sqrt(2*y/g);
     double x=c/cos(atan(b/a));
     double vx=yt*ax;
     int ans=1;
     while(x>0)
     {
         x-=(vx*2*yt+ax*yt*yt*2);
         if(x>0)ans++;
         else
            break;
vx=vx+2*ax*yt;
     }
     printf("%d\n",ans);


    }
    return 0;
}

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值