Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///#pragma GCC optimize("Ofast,no-stack-protector")
- ///#pragma GCC target("avx")
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #include <fstream>
- #include <functional>
- #include <cmath>
- #include <set>
- #include <deque>
- #include <queue>
- #include <utility>
- #include <map>
- #include <string>
- #include <iomanip>
- #include <utility>
- #include <ctype.h>
- #include <stdio.h>
- #include <random>
- #include <stack>
- #include <ctime>
- #include <unordered_map>
- #include <unordered_set>
- #include <tuple>
- #include "optimization.h"
- #define se second
- #define fi first
- #define mp make_pair
- #define pb push_back
- typedef long long ll;
- typedef long long ld;
- using namespace std;
- int main() {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- int V_0 = 25;
- int H = 100;
- double g = 9.81;
- int h = 2;
- double t = sqrt((2 * (H - h)) / g);
- cout << "t = " << fixed << setprecision(20) << t << endl;
- int x_c;
- cout << "введите иксцэ\n";
- cin >> x_c;
- int x_l = x_c - 10;
- int x_r = x_c + 10;
- double s_m = t * V_0;
- if (x_l < s_m && s_m < x_r) {
- cout << "ты попал ы цель\n";
- cout << "Vy = " << fixed << setprecision(20) << g * t;
- }
- else {
- cout << "не попал\n";
- cout << "Vy = " << fixed << setprecision(20) << g * t << ' ';
- cout << ", расстояние от старта = " << s_m;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement