67772023-12-19 09:40:01szabelrInverziócpp17Forditási hiba
#include <iostream>

using namespace std;

int main()
{
    int n,maxi=0,maxkez,maxveg,y=0;
    cin>>n;
    int tomb[n+1];
    for(int i=1; i<=n; i++)
    {
        cin>>tomb[i];
    }
    for(int i=1; i<n; i++)
    {
        y=i+1;
        while(y<=n)
        {
            if(tomb[y]<tomb[i]and (y-i+1)>maxi)
            {
                maxi = y-i+1;
                maxkez  = i;
                maxveg = y;
            }
            y++;
        }
    }
    cout<<maxkez<<" "<<maxveg;
    if(max==0)
        cout<<"-1";
    return 0;
}
Forditási hiba
exit status 1
main.cpp: In function 'int main()':
main.cpp:29:11: error: invalid operands of types '<unresolved overloaded function type>' and 'int' to binary 'operator=='
   29 |     if(max==0)
      |        ~~~^~~
Exited with error status 1