Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- #include <string>
- using namespace std;
- int main()
- {
- int n, masyvas[100], ats = 0, max = 0;
- cin >> n;
- for(int i = 0; i < n; i++)
- cin >> masyvas[i];
- for(int i=0;i<n;i++)
- masyvas[i] == 0 ? ++ats, (ats > max ? max = ats : NULL) : ats = 0;
- max == 0 ? cout << "No" << endl : cout << max << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement