<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Loading...

    java .net

    2007年6月6日 星期三

    ==============Fucai.java====================

    import java.util.Arrays;
    public class Fucai {

    private Integer[] redBall;

    public Fucai()
    {
       redBall = new Integer[33];
       for(int i = 0;i < 33;i++)
       {
        redBall[i] = i+1;
       }

    }

    public int[] getRedBallArray()
    {
       int[] redBallArray = new int[6];

       for(int i = 0;i < 6;i++)
       {
        int temp;
        int index = (int)(Math.random()*(33-1-i));
        redBallArray[i] = redBall[index];
        temp = redBall[index];
        redBall[index] = redBall[33-1-i];
        redBall[33-1-i] = temp;
        //System.out.println(index);
       }
       return redBallArray;
    }

    public int getBlueBall()
    {
       return (int)(Math.random()*(16));
    }

    public static void main(String[] args)
    {
       Fucai fucai = new Fucai();
       int[] redBallArray = fucai.getRedBallArray();
       Arrays.sort(redBallArray);
       System.out.print("紅球:");
       for(int i = 0;i < redBallArray.length;i++)
       {
        String numStr = redBallArray[i] + "";
        if(redBallArray[i]<10)
         numStr = "0" + redBallArray[i];
        System.out.print(numStr+",");
       }
       System.out.print("籃球:"+ fucai.getBlueBall());
       System.out.println();
       System.out.println("祝你好運!!!");
    }
    }

    ================Fucai.cs===================

    using System;
    using System.Collections.Generic;
    using System.Text;


    namespace FucaiApp
    {
         class Fucai
         {
             private int[] redBall;

             public Fucai()
             {
                 redBall = new int[33];
                 for (int i = 0; i < 33; i++)
                 {
                     redBall[i] = i + 1;
                 }

             }

             public String[] getRedBallArray()
             {
                 int[] redBallArray = new int[6];

                 for (int i = 0; i < 6; i++)
                 {
                     int temp;
                     int index = new System.Random().Next(33 - 1 - i);
                     redBallArray[i] = redBall[index];
                     temp = redBall[index];
                     redBall[index] = redBall[33 - 1 - i];
                     redBall[33 - 1 - i] = temp;
                 }
                 System.Array.Sort(redBallArray);

                 String[] redStr = new String[6];
                 for (int i = 0; i < redBallArray.Length; i++)
                 {
                     String numStr = redBallArray[i] + "";
                     if (redBallArray[i] < 10)
                         numStr = "0" + redBallArray[i];
                     redStr[i] = numStr;
                 }
                 return redStr;
             }

             public String getBlueBall()
             {
                 int blue = new System.Random().Next(1,16);
                 if (blue < 10)
                     return "0" + blue.ToString();
                 else
                     return blue.ToString();
             }
         }
    }

    posted on 2008-08-26 22:06 閱讀(86) 評論(0)  編輯  收藏


    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    公告

    希望有一天

    我能用鼠標雙擊我的錢包

    然后選中一張100元

    按住“ctrl+c”

    接著不停的“ctrl+v”

    嘻嘻~~~笑醒~~~



    導航

    <2008年8月>
    272829303112
    3456789
    10111213141516
    17181920212223
    24252627282930
    31123456

    統計

    常用鏈接

    留言簿(6)

    隨筆分類(102)

    隨筆檔案(398)

    文章分類

    文章檔案(10)

    有趣網絡

    搜索

    積分與排名

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 亚洲欧洲国产经精品香蕉网| 亚洲AV第一成肉网| 成人毛片视频免费网站观看| 国产成人亚洲综合无| 亚洲AV无码乱码在线观看裸奔 | 亚洲精品无码你懂的| 亚洲精品视频在线看| 亚洲一区二区三区免费观看 | 亚洲欧洲免费视频| 亚洲日产乱码一二三区别| 亚洲精品无码久久久影院相关影片| 亚洲无砖砖区免费| 人与动性xxxxx免费| 亚洲欧洲日产v特级毛片| 免费大片黄手机在线观看| 中文字幕无码播放免费| eeuss影院ss奇兵免费com| 亚洲人成网站看在线播放| 国产AV无码专区亚洲AV漫画| 在线观看的免费网站| 大地资源在线资源免费观看| 亚洲欧美黑人猛交群| 亚洲一二成人精品区| 亚洲国产中文字幕在线观看| 国色精品卡一卡2卡3卡4卡免费| 二个人看的www免费视频| 亚洲av综合av一区二区三区| 亚洲高清美女一区二区三区| 亚洲中文字幕无码久久2017| 毛片a级毛片免费播放下载 | 亚洲人成网站在线观看播放| 四虎影院免费视频| 182tv免费视视频线路一二三 | 啦啦啦在线免费视频| 在线永久看片免费的视频| 91成人免费观看在线观看| 朝桐光亚洲专区在线中文字幕| 成a人片亚洲日本久久| 77777_亚洲午夜久久多人| 亚洲综合精品香蕉久久网| 日本免费网站在线观看|