小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

隨機生成double二維數(shù)組的源程序

 執(zhí)著男孩 2006-09-13

    

/*
 * Created on 2006-6-21
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.tiantian;
import java.util.Random;
//import java.math.*;

/**
 * @author Administrator
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class RandomArray {
    public static double[][] GetArray(int a, int b) {
        double num = 0;
        Random random = new Random();
        int number = random.nextInt(100);
        int i = 10;
        int j = 10;
        double[][] a2;
        if ((a != 0) && (b != 0))
            a2 = new double[a][b];
        else
            a2 = new double[1][1];
        for (i = 0; i < a2.length; i++)
            for (j = 0; j < a2[i].length; j++) {
                num = random.nextDouble();
                a2[i][j] = num;
            }
        return a2;
    }
    public static void main(String[] args) {
        //Random random = new Random();
        //double num = random.nextDouble();
        //System.out.println(number);
        double[][] a = RandomArray.GetArray(10, 10);
        for (int i = 0; i < a.length; i++)
            for (int j = 0; j < a[i].length; j++) {
                System.out.println(a[i][j]);
            }
    }
}
 


    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約