public class C {
\x05private final static int LEFT = -1,RIGHT = 1,UP = 2,DOWN = -2;
\x05public static void main(String[] args) {
\x05\x05int count = 4;//控制行数
\x05\x05final int[][] ary = new int[count][count];
\x05\x05
\x05\x05int direction = RIGHT;
\x05\x05
\x05\x05int i = 1;
\x05\x05int row = 0,col = 0;
\x05\x05while(i 0){
\x05\x05\x05\x05\x05\x05row++;
\x05\x05\x05\x05\x05\x05col--;
\x05\x05\x05\x05\x05\x05direction = DOWN;
\x05\x05\x05\x05\x05}else{
\x05\x05\x05\x05\x05\x05ary[row][col++] = i++;
\x05\x05\x05\x05\x05}
\x05\x05\x05\x05\x05break;
\x05\x05\x05\x05case DOWN:
\x05\x05\x05\x05\x05if(row == count || ary[row][col] > 0){
\x05\x05\x05\x05\x05\x0