Advertisement
Mihao

Untitled

Dec 9th, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.34 KB | None | 0 0
  1. int x,y;
  2.  
  3.     printf ("podaj rozmiar ");
  4.     scanf("%d",&y);
  5.     scanf("%d",&x);
  6.     int **tab =(int**) malloc(y*sizeof(int*));
  7.     for(int i = 0 ; i < y ;i++)
  8.          tab[i] = (int* ) malloc(x* sizeof(int*));
  9.     srand(time(NULL));
  10.     for(int k = 0 ; k<y ; k++)
  11.     {
  12.         for(int j = 0 ; j < x ; j ++ )
  13.         {
  14.             tab[k][j]=rand() %10 ;
  15.             printf("%d ",tab[k][j]);
  16.  
  17.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement