解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int[][] a = new int[3][3]; for(byte i = 0; i < 3; i ++) { //读入 for(byte j = 0;j < 3;j++) { a[i][j] = scanner.nextInt(); } } for(byte i = 1; i < 3;i++) { //反转 int t; for(byte j = 0; j < i;j++) { t = a[i][j]; a[i][j] = a[j][i]; a[j][i] = t; } } for(byte i = 0; i < 3; i ++) { //输出 for(byte j = 0;j < 3; j++) { System.out.print(a[i][j] + " "); } System.out.println(); } } }
0.0分
0 人评分