Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int maxLen = 0, nowLen = 0;
- for (int i = 0; i < n; i++) {
- if (a[i] == 0)
- nowLen++;
- else{
- if (maxLen < nowLen)
- maxLen = nowLen;
- nowLen = 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement