```
class Solution {
public:
int findMaxConsecutiveOnes(vector<int>& nums) {
int point = -1,res = 0;
for (int i = 0; i < nums.size();i++)
{
int begin = i;
while (i<nums.size() && nums[i] == 1)
{
res = max(res, i - begin + 1);
i++;
}
}
return res;
}
};
```