WA (line:4)
您共輸出 3 行。
以上是錯誤
----------------------------------------
import java.util.Scanner;
public class a015 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int[][] input = new int[a][b];
int[][] output = new int[b][a];
int i, j;
for (i = 0; i < a; i++) {
for (j = 0; j < b; j++) {
input[i][j] = scan.nextInt();
output[j][i] = input[i][j];
}
}
for (j = 0; j < b; j++) {
for (i = 0; i < a; i++) {
System.out.print(output[j][i]+" ");
}
System.out.printf("\n");
}
scan.close();
}
}
WA (line:4)
您共輸出 3 行。
以上是錯誤
----------------------------------------
import java.util.Scanner;
public class a015 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
int[][] input = new int[a][b];
int[][] output = new int[b][a];
int i, j;
for (i = 0; i < a; i++) {
for (j = 0; j < b; j++) {
input[i][j] = scan.nextInt();
output[j][i] = input[i][j];
}
}
for (j = 0; j < b; j++) {
for (i = 0; i < a; i++) {
System.out.print(output[j][i]+" ");
}
System.out.printf("\n");
}
scan.close();
}
}
我建議你可去看看我的
說不定可以找到盲點