SHARE
TWEET

Untitled

a guest Oct 13th, 2017 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int32_t main()
  6. {
  7.     bool asc, wasc, des, wdes, con;
  8.     asc = wasc = des = wdes = con = true;
  9.  
  10.     int old, curr;
  11.     cin >> old >> curr;
  12.  
  13.     while (curr != -2000000000)
  14.     {
  15.         if (curr <= old)
  16.             asc = false;
  17.  
  18.         if (curr < old)
  19.             wasc = false;
  20.  
  21.         if (curr >= old)
  22.             des = false;
  23.  
  24.         if (curr > old)
  25.             wdes = false;
  26.  
  27.         if (curr != old)
  28.             con = false;
  29.  
  30.         old = curr;
  31.         cin >> curr;
  32.     }
  33.  
  34.     if (asc)
  35.         cout << "ASCENDING";
  36.     else if (des)
  37.         cout << "DESCENDING";
  38.     else if (con)
  39.         cout << "CONSTANT";
  40.     else if (wasc)
  41.         cout << "WEAKLY ASCENDING";
  42.     else if (wdes)
  43.         cout << "WEAKLY DESCENDING";
  44.     else
  45.         cout << "RANDOM";
  46.  
  47.     return 0;
  48. }
RAW Paste Data
Top