Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(int argc,char **argv)
- {
- short i,j;
- scanf("%hd%hd",&i,&j);
- puts("-----------------------------------------------");
- int Matrix [i-1][j-1];
- for(short ii =0;ii<i;ii++)
- for(short jj=0;jj<j;jj++)
- scanf("%d",&Matrix[ii][jj]);
- puts("-----------------------------------------------");
- for(short ii =0;ii<i;ii++)
- for(short jj=0;jj<j;jj++)
- printf("Matrix[%d][%d] = %d n",ii,jj,Matrix[ii][jj]);
- }
- $ ./a.out
- 3 3
- -----------------------------------------------
- 1 2 3
- 4 5 6
- 7 8 9
- -----------------------------------------------
- Matrix[0][0] = 1
- Matrix[0][1] = 2
- Matrix[0][2] = 4
- Matrix[1][0] = 4
- Matrix[1][1] = 5
- Matrix[1][2] = 7
- Matrix[2][0] = 7
- Matrix[2][1] = 18
- Matrix[2][2] = 48
Add Comment
Please, Sign In to add comment