Răspuns :
#include <fstream>
using namespace std;
ifstream fin("platou3.in");
ofstream fout("platou3.out");
int main()
{
int n, x, secv = 0, mx = 0;
fin>>n;
for(int i = 0; i < n; i++)
{
fin>>x;
if(x > 0) secv++;
else
{
if(secv > mx) mx = secv;
secv = 0;
}
}
if(secv > mx) mx = secv;
fout<<mx;
}
using namespace std;
ifstream fin("platou3.in");
ofstream fout("platou3.out");
int main()
{
int n, x, secv = 0, mx = 0;
fin>>n;
for(int i = 0; i < n; i++)
{
fin>>x;
if(x > 0) secv++;
else
{
if(secv > mx) mx = secv;
secv = 0;
}
}
if(secv > mx) mx = secv;
fout<<mx;
}
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("platou3.in");
ofstream fout ("platou3.out");
int n,x,y,k,Max=1;
int main()
{
fin >> n;
for(int i=1;i<=n;i++)
{
fin >> x;
if(i>1 and x>0 and y>0)
Max++;
else
Max=1;
if(Max>k)
k=Max;
y=x;
}
fout << k;
return 0;
}
using namespace std;
ifstream fin ("platou3.in");
ofstream fout ("platou3.out");
int n,x,y,k,Max=1;
int main()
{
fin >> n;
for(int i=1;i<=n;i++)
{
fin >> x;
if(i>1 and x>0 and y>0)
Max++;
else
Max=1;
if(Max>k)
k=Max;
y=x;
}
fout << k;
return 0;
}