Консультации

what is wrong?

what is wrong?

от nikoloz gabriadze -
Number of replies: 1
#include
using namespace std;
int a[1000];
long n,o=0,i,c,e=0,h,j,l,a1,as=0,m=5,f,s,y,p=0,z,g;
int datvla (){
for(int j=l;j<=l+h-1;j++){
y=y+5-a[j];
}
for(int j=z;j<=z+e-1;j++)
p=p+5-a[j];
if(y>p);
if(y==p){
if(m>as);else {h=e;l=z;e=0;}
}

if(y

h=e;l=z;e=0;as=m;}
}
int jami(){
for(i=l;i<=l+h-1;i++){
y=y+5-a[i];
}
}
int main()
{
cin>>n;
z=0;
h=0;
l=0;
y=0;
for(i=1;i<=n;i++){
cin>>a[i];
y=0;p=0;
if(a[i]!=5){
if(m>=a[i]){
m=a[i];
}
z=i-e;
e++;
}
if(a[i]==5 || i==n)
a1 = datvla ();
}
y=0;
c=jami();
s=l;
while(a[s]==5){
o++;
s++;
}
if(l+h-1<=0){cout< cout< return 0;
}