243
>
//af semigradul interior/exterior ptr un vf i
#include <stdio.h>
#include <conio.h>
void main(void)
{
int a[50][50],interior[50],exterior[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++)
{
interior[i]=0;
exterior[i]=0;
}
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
{
if (a[i][j]==1) exterior[i]++;
if (a[j][i]==1) interior[i]++;
}
for(i=1;i<=n;i++)
{
printf("nVarful %d:",i);
printf("nSemigrad interior: %d",interior[i]);
printf("nSemigrad exterior: %d n",exterior[i]);
}
getch();
}