题意:在b*a的区域打台球,初始位置在中点,s秒之后,与水平边撞击n次,与垂直边撞击m次,并回到中点,求球的初速度与角度。

题解:球的水平速度设为Vx,那么s秒后水平路程为Vx*s,与垂直边撞击m次又回到中点,由此得到水平路程为m*a,于是Vx*s=m*a,同理Vy*s=n*b,两式联立得答案。

View Code
 1 #include<cstdio>
 2 #include<cstring>
 3 #include<cmath>
 4 using namespace std;
 5 const double pi=acos(-1.0);
 6 int main()
 7 {
 8     double a,b,s,m,n,v,th;
 9     while(scanf("%lf%lf%lf%lf%lf",&a,&b,&s,&m,&n),(a||b||s||m||n))
10     {
11         th=atan2(n*b,m*a);
12         v=sqrt(m*m*a*a+n*n*b*b)/s;
13         printf("%.2lf %.2lf\n",th*180.0/pi,v);
14     }
15     return 0;
16 }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-02-11
  • 2022-01-30
  • 2021-05-26
  • 2022-12-23
  • 2022-01-19
  • 2021-11-19
猜你喜欢
  • 2022-01-05
  • 2021-09-08
  • 2021-11-04
  • 2021-05-30
  • 2021-08-11
  • 2021-09-19
  • 2022-12-23
相关资源
相似解决方案