Advertisement
Guest User

Untitled

a guest
Apr 29th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.35 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. #include <string>
  4. using namespace std;
  5. int main()
  6. {
  7.   int n, masyvas[100], ats = 0, max = 0;
  8.   cin >> n;
  9.   for(int i = 0; i < n; i++)
  10.     cin >> masyvas[i];
  11.   for(int i=0;i<n;i++)
  12.     masyvas[i] == 0 ? ++ats, (ats > max ? max = ats : NULL) : ats = 0;
  13.   max == 0 ? cout << "No" << endl : cout << max << endl;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement