samedi 13 février 2021

what does this means:[Warning] pointer to a function used in arithmetic [-Wpointer-arith]Im trying to solve a problem and this appears everytime

#include using namespace std; long long brr(long long niz[10][10], long long x, long long y, long long n){ long long br=0; for(long long i=x;i<=n;--i){ if(niz[i][y]!=1){ ++br; } } return br; } long long brr1(long long niz[10][10], long long x, long long y, long long n){ long long br=0; for(long long j=y;j<=n;--j){ if(niz[x][j]!=1){ ++br; } } return br; } long long brr2(long long niz[10][10], long long x, long long y, long long n){ long long br=0; for(long long i=x;i<=n;++i){ if(niz[i][y]!=1){ ++br; } } return br; } long long brr3(long long niz[10][10], long long x, long long y, long long n){ long long br=0; for(long long j=y;j<=n;++j){ if(niz[x][j]!=1){ ++br; } } return br; } int main(){ long long n,m,nm[100][100],x,y,mn[100],mnn[100]; long long br=0; cin>>n>>m; for(int i=0;i<n;++i){ for(int j=0;j<n;++j){ nm[i][j]=0; } } //long long br=m; for(int i=1;i<=n;++i){ cin>>mn[i]>>mnn[i]; nm[mn[i]][mnn[i]]=1; } for(int i=1;i<=n;++i){ br=brr[nm,mn[i],mnn[i],n]+brr1[nm,mn[i],mnn[i],n]+brr2[nm,mn[i],mnn[i],n]+brr3[nm,mn[i],mnn[i],n]; } cout<<br; return 0; }

Aucun commentaire:

Enregistrer un commentaire