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++)
- {
- if(masyvas[i] == 0) {
- ++ats;
- if (ats > max) {
- max = ats;
- }
- }
- else
- {
- ats = 0;
- }
- }
- if(max == 0 )
- {
- cout<<"No"<<endl;
- }
- else
- {
- cout << max << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement