File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change
1
+ import java .util .*;
2
+
3
+ class TestClass {
4
+ public static void main (String args [] ) throws Exception {
5
+ Scanner sc = new Scanner (System .in );
6
+ int n = sc .nextInt ();
7
+ int a [] = new int [n ];
8
+ for (int i = 0 ; i < n ; i ++) {
9
+ a [i ] = sc .nextInt ();
10
+ }
11
+ for (int i = n - 1 ; i >= 0 ; i --) {
12
+ System .out .println (a [i ]);
13
+ }
14
+ }
15
+ }
Original file line number Diff line number Diff line change
1
+ import java .util .*;
2
+ class TestClass {
3
+ public static void main (String args [] ) throws Exception {
4
+ Scanner sc = new Scanner (System .in );
5
+ int r = sc .nextInt ();
6
+ int c = sc .nextInt ();
7
+ int a [][] = new int [r ][c ];
8
+ for (int i = 0 ; i < r ; i ++) {
9
+ for (int j = 0 ; j < c ; j ++) {
10
+ a [i ][j ] = sc .nextInt ();
11
+ }
12
+ }
13
+ for (int i = 0 ; i < c ; i ++) {
14
+ for (int j = 0 ; j < r ; j ++) {
15
+ System .out .print (a [j ][i ] + " " );
16
+ }
17
+ System .out .println ();
18
+ }
19
+ }
20
+
21
+ }
You can’t perform that action at this time.
0 commit comments