- 问答
- 2019-05-14 18:26:32 @
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 条评论
-
小熊 (wlnirvana) LV 8 MOD @ 2019-05-14 19:40:24
排版很乱呀。不过看起来你自己好像快解决了?
- 1