Javaタイプバック配列を印刷します。

2503 ワード

多くの人がこの問題に悩んでいるのを見て、暇な時に遊んでいます。下のコードを入れて鑑賞させます。みんなが見終わったらとても楽しいです。
/** 
 * @class       Su_Huirong  
 * @author Su_Huirong 
 * @time 5   
 * @version Su_Huirong 5                    3h  
 */  
import java.util.Scanner;  
public class Test {  
    /** 
     * @row   
     * @length   
     * @sum        
     * @math     :       ,        
     */  
    int row,length;  
    int num;  
    int[][] math;  
    /** 
     *      : 
     *       sum     ,          
     */  
    public void initial(){  
        /** 
         * @temp       sum       ,        ,  sum 24,   1、2、3、4、6、8、12。       4、6      1、12 
         */  
        int temp=num+1;  
        length=(num+1)/2;  
        for(int i=temp;i>0;i--){  
            for(int j=1;j<=i;j++){  
                if(i*j==num&&i-j0){  
                    followLength--;  
                }  
                while(length0){  
                    followRow--;  
                }  
                while(rowflagLength){  
                followLength=0;  
                while(math[row][followLength]!=0&&followLengthfollowLength){  
                    math[row][length--]=i++;  
                }  
                flagRow=row-1;  
                flagLength=length;  
            }  
            /**  */  
            if(row>flagRow&&length==flagLength){  
                followRow=0;  
                while(math[followRow][length]!=0){  
                    followRow++;  
                }  
                do{  
                    math[row--][length]=i++;  
                }while(row>followRow);  
                flagRow=row;  
                flagLength=length+1;  
            }  
              
        }  
    }  
    /** 
     * @show()          
     * 
     */  
    public void show(){  
        for(int i=0;i