Advertisement
rafid_shad

lol

Oct 16th, 2020 (edited)
639
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4. int main()
  5. {
  6.  
  7.     cout << fixed << setprecision(2);
  8.    double h, x, v;
  9.    cin >> h >> x >> v;
  10.    double v1 = (2 * 9.8 * h);
  11.    v1 = sqrt(v1);
  12.    double t1 = (v1 / 9.8 );
  13.  
  14.    //cout << t1 << endl;
  15.  
  16.    double t2 = x/v;
  17.   // cout << t2 << endl;
  18.  
  19.    if(t1 < t2) {
  20.         cout << "NO " ;
  21.         double c = x/t1;
  22.         cout  << c-v << " m/s" << endl;
  23.    }
  24.    else cout << "YES" << endl;
  25.  
  26.  
  27. }
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement