Created
October 18, 2015 18:54
-
-
Save StrixG/955542259c06fd63a643 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Test { | |
static Scanner in = new Scanner(System.in); | |
public static void main(String[] args) { | |
int i, j; | |
int n = in.nextInt(); | |
int m = in.nextInt(); | |
int[][] a = new int[n][m]; | |
for (i = 0; i < n; i++) { | |
for (j = 0; j < m; j++) | |
a[i][j] = in.nextInt(); | |
} | |
System.out.format("%d %d\n", m, n); | |
for (i = 0; i < m; i++) { | |
for (j = n - 1; j > 0; j--) { | |
System.out.format("%d ", a[j][i]); | |
} | |
System.out.format("%d\n", a[j][i]); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment