Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(int argc, const char * argv[]) {
- int n;
- scanf("%d",&n);
- int mat[n][n];
- for(int i = 0; i < n; i++) {
- for(int j = 0; j < n; j++) {
- scanf("%d", &mat[i][j]);
- }
- }
- for(int i = 0; i < n; i++) {
- printf("%d\n", mat[i][n - 1 - i]);
- }
- // i = 0, n - i - 1 = 4 - 1 - 0 = 3
- // i = 1, n - 1 - 1 = 4 - 2 = 2
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement