220082026-01-14 12:37:55BDavid5616Fasor (40)cpp11Forditási hiba
#include <iostream>
using namespace std;
int 

int main()
{int i,s,t,b,a[200000],n,k;
    cin>>n>>k;
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    b=-1;i=0;
    while(i<n && b==-1){t=1;s=1;
        if(i+k<n && i-k<=0){while(s<=k && t==1){
            if(a[i]<a[i+s])t=0;
            s++;
        }
        }
        else {s=1;
            while(s<=k && t==1){
                if(a[i]<a[i-s] || a[i]<a[i+s])t=0;
                s++;
            }
        }
        if(t==1)b=i+1;
        i++;
    }cout<<b;
    return 0;
}
Forditási hiba
open /var/local/lib/isolate/404/box/a.out: no such file or directory
main.cpp:3:1: error: two or more data types in declaration of 'main'
    3 | int
      | ^~~