C蓝色C
import ng。*;
import java。util。*;
import 。*;
public class Radm{
public static void main(String[] args){
Random r = new Random();
TreeSet ts = new TreeSet();
int a1 = 0;
int a2 = 0;
int a3 = 0;
int a4 = 0;
int a5 = 0;
int a6 = 0;
int a7 = 0;
int a8 = 0;
int a9 = 0;
int a10 = 0;
int a11 = 0;
int a12 = 0;
int a13 = 0;
int a14 = 0;
int a15 = 0;
int a16 = 0;
int a17 = 0;
int a18 = 0;
int a19 = 0;
int a20 = 0;
int a21 = 0;
int a22 = 0;
int a23 = 0;
int a24 = 0;
int a25 = 0;
int a26 = 0;
int a27 = 0;
int a28 = 0;
int a29= 0;
int a30 = 0;
int a31 = 0;
int a32 = 0;
int a33 = 0;
int a0 = 0;
for(int p=0;p<5;p++){
for(int i=0;i<1000000;i++){
int n = (int)( xtDouble()*33+1);
switch(n){
case 1:a1++;break;
case 2:a2++;break;
case 3:a3++;break;
case 4:a4++;break;
case 5:a5++;break;
case 6:a6++;break;
case 7:a7++;break;
case 8:a8++;break;
case 9:a9++;break;
case 10:a10++;break;
case 11:a11++;break;
case 12:a12++;break;
case 13:a13++;break;
case 14:a14++;break;
case 15:a15++;break;
case 16:a16++;break;
case 17:a17++;break;
case 18:a18++;break;
case 19:a19++;break;
case 20:a20++;break;
case 21:a21++;break;
case 22:a22++;break;
case 23:a23++;break;
case 24:a24++;break;
case 25:a25++;break;
case 26:a26++;break;
case 27:a27++;break;
case 28:a28++;break;
case 29:a29++;break;
case 30:a30++;break;
case 31:a31++;break;
case 32:a32++;break;
case 33:a33++;break;
default : a0++;
}
}
TreeMap tm = new TreeMap();
tm。 put(new Integer(a1),"01");
tm。put(new Integer(a2),"02");
tm。put(new Integer(a3),"03");
tm。 put(new Integer(a4),"04");
tm。put(new Integer(a5),"05");
tm。 put(new Integer(a6),"06");
tm。 put(new Integer(a7),"07");
tm。put(new Integer(a8),"08");
tm。put(new Integer(a9),"09");
tm。 put(new Integer(a10),"10");
tm。 put(new Integer(a11),"11");
tm。put(new Integer(a12),"12");
tm。 put(new Integer(a13),"13");
tm。put(new Integer(a14),"14");
tm。 put(new Integer(a15),"15");
tm。 put(new Integer(a16),"16");
tm。put(new Integer(a17),"17");
tm。put(new Integer(a18),"18");
tm。 put(new Integer(a19),"19");
tm。put(new Integer(a20),"20");
tm。put(new Integer(a21),"21");
tm。 put(new Integer(a22),"22");
tm。 put(new Integer(a23),"23");
tm。put(new Integer(a24),"24");
tm。 put(new Integer(a25),"25");
tm。put(new Integer(a26),"26");
tm。 put(new Integer(a27),"27");
tm。 put(new Integer(a28),"28");
tm。put(new Integer(a29),"29");
tm。put(new Integer(a30),"30");
tm。 put(new Integer(a31),"31");
tm。put(new Integer(a32),"32");
tm。put(new Integer(a33),"33");
Object o= stKey();
String v=(String)( t(o));
//return v;
intln(v);
}
//public static void main(String [] args){
int m1=0,m2=0,m3=0,m4=0,m5=0,m6=0,m7=0,m8=0,m9=0,m10=0,m11=0,m12=0,m13=0,m14=0,m15=0,m16=0;
for(int j=0;j<1000000;j++){
int b = (int)( xtInt()*16+1);
switch(b){
case 1:m1++;break;
case 2:m2++;break;
case 3:m3++;break;
case 4:m4++;break;
case 5:m5++;break;
case 6:m6++;break;
case 7:m7++;break;
case 8:m8++;break;
case 9:m9++;break;
case 10:m10++;break;
case 11:m11++;break;
case 12:m12++;break;
case 13:m13++;break;
case 14:m14++;break;
case 15:m15++;break;
case 16:m16++;break;
}
}
TreeMap tm1 = new TreeMap();
tm1。 put(new Integer(m1),"01");
tm1。put(new Integer(m2),"02");
tm1。put(new Integer(m3),"03");
tm1。 put(new Integer(m4),"04");
tm1。 put(new Integer(m5),"05");
tm1。put(new Integer(m6),"06");
tm1。 put(new Integer(m7),"07");
tm1。put(new Integer(m8),"08");
tm1。 put(new Integer(m9),"09");
tm1。 put(new Integer(m10),"10");
tm1。put(new Integer(m11),"11");
tm1。put(new Integer(m12),"12");
tm1。 put(new Integer(m13),"13");
tm1。put(new Integer(m14),"14");
tm1。put(new Integer(m15),"15");
tm1。 put(new Integer(m16),"16");
Object s= stKey();
String w=(String)( t(s));
intln("中奖号码"+" "+w);
}
}
。 。
原贴:如何编写最基础简单的程序