Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main() {
- int n, m;
- scanf("%d%d", &n, &m);
- int matrica[n][m];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < m; j++) {
- scanf("%d", &matrica[i][j]);
- }
- }
- for(int i = 0; i < n; i++) {
- printf("%d ", matrica[i][i]);
- }
- return 0;
- }
- /*
- 4 4
- 1 2 3 4
- 5 6 7 8
- 9 10 11 12
- 13 14 15 16
- **/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement