Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, a, lenOfMax, count, previous;
- cin >> n;
- lenOfMax = 0;
- count = 0;
- previous = 0;
- for (int i = 0; i < n; i++)
- {
- cin >> a;
- if (a >= previous)
- count++;
- else
- {
- if (count > lenOfMax)
- lenOfMax = count;
- count = 1;
- }
- previous = a;
- }
- cout << lenOfMax << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement