Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #define N 10
- int main()
- {
- int row,col,i,j,count=0;
- int *a[N];
- printf("Nr. de linii:");
- scanf("%d",&row);
- printf("Nr. de coloane:");
- scanf("%d",&col);
- for(i=0 ; i<row ;i++)
- a[i]=(int*)malloc(col*sizeof(int));
- for(i=0 ; i<row ; i++)
- for(j=0 ; j<col ; j++)
- scanf("%d",&a[i][j]);
- printf("\n");
- for (i = 0; i < row; i++) {
- for (j = 0; j < col; j++)
- printf("%d ", a[i][j]);
- printf("\n");
- }
- for(i=0 ;i<row ;i++)
- free(a[i]);
- free(a);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement