Advertisement
Guest User

Untitled

a guest
Jan 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.   int n;
  7.   cin>>n;
  8.  
  9.   int max_count = 1;
  10.   int count = 1;
  11.   int last;
  12.   cin>>last;
  13.  
  14.   for(int i = 0; i < n - 1; i++) {
  15.     int cur;
  16.     cin>>cur;
  17.  
  18.     if(cur > last) {
  19.       count++;
  20.  
  21.       if(count > max_count)
  22.         max_count = count;
  23.     } else {
  24.       count = 1;
  25.     }
  26.  
  27.     last = cur;
  28.   }
  29.  
  30.   cout<<max_count;
  31.  
  32.   return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement