Advertisement
STANAANDREY

progres

Nov 24th, 2018
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;//  \  ||
  4.  
  5. int main ()
  6. {
  7.   int n,i=1,a=0,b,lg=0,lgmax=0;
  8.   cout<<"nr note=";cin>>n;
  9.   cout<<"intodu notele=";
  10.   while (i<=n)
  11.   {
  12.       cin>>b;
  13.       if (a<=b)
  14.         lg++;
  15.       else
  16.       {
  17.           if (lgmax<lg)
  18.             lgmax=lg;
  19.           lg=1;
  20.       }
  21.       a=b;
  22.       i++;
  23.   }
  24.   if (lgmax<lg)
  25.     lgmax=lg;
  26.   cout<<"lgmax="<<lgmax;
  27.  
  28.     return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement