235
>
//se afiseaza arcele incidente spre exterior/interior ale varfului 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("nArcele incidente catre exterior din vf %d sunt:",i);
for(j=1;j<=n;j++)
if(a[i][j]==1) printf(" [%d-%d]",i,j);
}
for(i=1;i<=n;i++)
{
printf("nArcele incidente catre interior spre vf %d sunt:",i);
for(j=1;j<=n;j++)
if(a[j][i]==1) printf(" [%d-%d]",j,i);
}
getch();
}