#include <iostream> #include <fstream> using namespace std; int substr(int nums[], int len) { int ans = 0, cur = 0; for(int i= 0; i < len; i++) { if(nums[i] != 0) { cur++; if(cur > ans) ans = cur; } else cur = 0; } return ans; } int main() { ifstream cin("s.in"); int n; int s[100000], i = 0; while(cin >> n) { s[i++] = n; } cout << substr(s, i) << endl; system("pause"); return 0; }