Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- void solve(){
- int h1, h2, h3, h4;
- cin >> h1 >> h2 >> h3 >> h4;
- if (h1 <= h2 && h2 <= h3 && h3 <= h4){ // 1 условие
- cout << "YES" << endl;
- }else if (h1 >= h2 && h2 >= h3 && h3 >= h4){ // 2 условие
- cout << "YES" << endl;
- }else{
- cout << "NO" << endl;
- }
- }
- int main(){
- ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0); // Оптимизация
- solve();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement