Advertisement
nq1s788

Untitled

Nov 23rd, 2022
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.44 KB | None | 0 0
  1. ///#pragma GCC optimize("Ofast,no-stack-protector")
  2. ///#pragma GCC target("avx")
  3. #include <iostream>
  4. #include <vector>
  5. #include <algorithm>
  6. #include <fstream>
  7. #include <functional>
  8. #include <cmath>
  9. #include <set>
  10. #include <deque>
  11. #include <queue>
  12. #include <utility>
  13. #include <map>
  14. #include <string>
  15. #include <iomanip>
  16. #include <utility>
  17. #include <ctype.h>
  18. #include <stdio.h>
  19. #include <random>
  20. #include <stack>
  21. #include <ctime>
  22. #include <unordered_map>
  23. #include <unordered_set>
  24. #include <tuple>
  25. #include "optimization.h"
  26.  
  27. #define se second
  28. #define fi first
  29. #define mp make_pair
  30. #define pb push_back
  31.  
  32. typedef long long ll;
  33. typedef long long ld;
  34.  
  35. using namespace std;
  36.  
  37. int main() {
  38.     ios_base::sync_with_stdio(0);
  39.     cin.tie(0);
  40.     int V_0 = 25;
  41.     int H = 100;
  42.     double g = 9.81;
  43.     int h = 2;
  44.     double t = sqrt((2 * (H - h)) / g);
  45.     cout << "t = " << fixed << setprecision(20) << t << endl;
  46.     int x_c;
  47.     cout << "введите иксцэ\n";
  48.     cin >> x_c;
  49.     int x_l = x_c - 10;
  50.     int x_r = x_c + 10;
  51.     double s_m = t * V_0;
  52.     if (x_l < s_m && s_m < x_r) {
  53.         cout << "ты попал ы цель\n";
  54.         cout << "Vy = " << fixed << setprecision(20) << g * t;
  55.     }
  56.     else {
  57.         cout << "не попал\n";
  58.         cout << "Vy = " << fixed << setprecision(20) << g * t << ' ';
  59.         cout << ", расстояние от старта = " << s_m;
  60.     }
  61.     return 0;
  62. }
  63.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement