β Simple Transpose (Contest)
Simple Transpose easy Time Limit: 2 sec Memory Limit: 128000 kB
```java
import java.io.*; // for handling input/output
import java.util.*; // contains Collections framework
// don't change the name of this class
// you can add inner classes if needed
class Main {
public static void main (String[] args) {
// Your code here
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int arr[][] = new int[n][n];
for(int r =0; r<n;r++){
for(int c=0;c<n;c++){
arr[r][c] = sc.nextInt();
}
}
for(int r=0;r<n;r++){
for(int c=0;c<n;c++){
System.out.print(arr[c][r]+" ");
}
System.out.println();
}
}
}
```Last updated