Advertisement
InnaSibirova

Untitled

Oct 13th, 2021
1,072
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main() {
  4.     int n, flag1 = 0, flag2 = 0;
  5.     cin >> n;
  6.     int s[n];
  7.     for(int i = 0; i < n; i++) {
  8.         cin >> s[i];
  9.     }
  10.     for (int i = 1; i < n; i++) {
  11.         if(s[i] >= s[i-1]) {
  12.             flag1++;
  13.         }
  14.         if(s[i] <= s[i-1]) {
  15.             flag2++;
  16.         }
  17.     }
  18.     if(flag1 == n-1 && flag2 == n-1) {
  19.         cout << "vse ravni";
  20.     }
  21.     else if(flag1 == n-1) {
  22.         cout << "vozrastaet";
  23.     }
  24.     else if(flag2 == n-1) {
  25.         cout << "ybivaet"; 
  26.     }
  27.     else{
  28.         cout << "neuporydacheno";
  29.     }
  30.    
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement