艺术第三题我的图转只转过来一半,另一半没了

import java.util.Scanner;
import java.io.PrintStream;

public class Main {
public static void main(String[] args) throws java.io.UnsupportedEncodingException {
PrintStream ps = new PrintStream(System.out, true, "UTF-8");
Scanner in = new Scanner(System.in, "UTF-8");

int kuan = in.nextInt();
int gao = in.nextInt();
int[][] a = new int[gao][kuan];
for (int i = 0; i < gao; i++) {
for (int j = 0; j < kuan; j++) {
a[i][j] = in.nextInt();

}
}

for (int m = 0,d=0; m < gao; m++,d++) {
for (int n = 0,b=gao-1; n < gao; n++,b--) {
if (a[b][d] == 0) {
ps.print(" ");
} else if (a[b][d] == 1) {
ps.print("*");
}

}
ps.println();
}
}
}

1 条评论

  • 1