Advertisement
miglss

1

Mar 21st, 2023
26
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. void solve(){
  4. int h1, h2, h3, h4;
  5. cin >> h1 >> h2 >> h3 >> h4;
  6. if (h1 <= h2 && h2 <= h3 && h3 <= h4){ // 1 условие
  7. cout << "YES" << endl;
  8. }else if (h1 >= h2 && h2 >= h3 && h3 >= h4){ // 2 условие
  9. cout << "YES" << endl;
  10. }else{
  11. cout << "NO" << endl;
  12. }
  13. }
  14.  
  15. int main(){
  16. ios::sync_with_stdio(NULL), cin.tie(0), cout.tie(0); // Оптимизация
  17. solve();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement