Skip to content

Instantly share code, notes, and snippets.

@StrixG
Created October 18, 2015 18:54
Show Gist options
  • Save StrixG/955542259c06fd63a643 to your computer and use it in GitHub Desktop.
Save StrixG/955542259c06fd63a643 to your computer and use it in GitHub Desktop.
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