#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<time.h>

main()
{
int m,i,j,matice[10][10],pom=0;
time_t t;

srand((unsigned) time(&t));

clrscr();
printf("Zadej velikost matice (max 10): ");
do
 {
  scanf("%d",&m);
 }
while(m>11 && m<0);

printf("\n");

/* plni matice nahodnymi cisly 0-1 */
for(j=0;j<m;j++)
  {
   for(i=0;i<m;i++)
    {
    matice[i][j]=random(2);
    }
  }

/* vypisuje matici */
for(j=0;j<m;j++)
  {
   for(i=0;i<m;i++)
    {
    printf("%d",matice[i][j]);
    if(i==m-1) printf("\n");
    }
  }

/* kontrola matice, zda je symetricka */
for(j=0;j<m;j++)
  {
   for(i=0;i<j;i++)
    {

     if (matice[i][j]!=matice[j][i])
	{
	 pom=1;
	 break;
	}

    }
  }

 if (pom==1) printf("\nMatice neni symetricka");
 else printf("\nMatice je symetricka");
getch();

}