Advertisement
Guest User

kefa boi

a guest
Jul 16th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.33 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.     //input
  6.     int n,count=1,maxcount=count;
  7.     cin>>n;
  8.     int seq[n];
  9.    
  10.     for(int i=0;i<n;i++){
  11.         cin>>seq[i];
  12.         if(i>0){
  13.             if(seq[i]>=seq[i-1]){
  14.                 count++;
  15.                 maxcount=count;
  16.             }
  17.             else{
  18.                 count=1;
  19.             }
  20.         }
  21.     }
  22.     //output
  23.     cout<<endl<<maxcount;
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement