218
>Afisare vecinii unui nod i
//af vecinii unui nod i
# include <stdio.h>
# include <conio.h>
void main(void)
{
int a[50][50],n,i,j;
FILE *f=fopen("c:intrare.txt","r");
fscanf(f,"%d",&n);
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
fscanf(f,"%d",&a[i][j]);
fclose(f);
for(i=1;i<=n;i++)
{
printf("nVecinii vf %d sunt:n",i);
for(j=1;j<=n;j++)
if((a[i][j]==1)||(a[j][i]==1)) printf(" %d ",j);
}
getch();
clrscr();
}