请你对行和列都倒置,然后输出之。
import java.util.Scanner;
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
// 注意 hasNext 和 hasNextLine 的区别
while (in.hasNextInt()) { // 注意 while 处理多个 case
int n = in.nextInt();
int m = in.nextInt();
String []all=new String[n];
for(int i=0;i<n;i++){
String s=in.next();
StringBuilder sb=new StringBuilder(s);
all[i]=sb.reverse().toString();
}
for(int i=all.length-1;i>=0;i--){
System.out.println(all[i]);
}
}
}
} import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
in.nextInt();
in.nextLine();
StringBuilder res = new StringBuilder();
for(int i = 0;i<n;i++) {
String str = in.nextLine();
StringBuilder sb = new StringBuilder(str);
String tmp = sb.reverse().append("\n").toString();
res.insert(0,tmp);
}
System.out.println(res.toString());
}
}