Почему не работает код? синтаксическая ошибка после next:

#include <stdio.h>
#include <conio.h>
int main(int argc, char* argv[])
{int nstr,nstb,i,j;
 int a[4][4];
 
{printf("\nVvedite kol-vo strok: ");
scanf ("%d",&nstr);
printf("\nVvedite kol-vo stolbcov: ");
scanf("%d",&nstb);}
 
    printf("\nVvedite elementi massiva: \n");
          {for (i=0;i<nstr;i++)
          for (j=0;j<nstb;j++)
          scanf("%d",&a[i][j]);}
 
          for (i=0;i<nstr;i++)
 
 
for (j=0;j<nstb-1;j++)
{
if (a[i][j]!=a[i][j+1]) goto next;
for (j=0;j<nstb;j++)
a[i][j]=0;
next:
}
 
 
 
 
 
          for (i=0;i<nstr;i++)
          for (j=0;j<nstb;j++)
           printf("\nnovi massiv: %d\n",a[i][j]);
 
      getch();
 
        return 0;
}

Ответы (1 шт):

Автор решения: Aziz Umarov

так сделайте

for (j=0;j<nstb-1;j++)
{
  if (a[i][j] == a[i][j+1]) {
   for (j=0;j<nstb;j++)
       a[i][j]=0;
  }
}
→ Ссылка