JAVA大乐透摇号模拟工具

public class DaLeTou {
	
	public static int getRandom1() {  //前区号码1-35
		return (int)(Math.random()*35+1);
	}
	public static int getRandom2() {  //后区号码1-12
		return (int)(Math.random()*12+1);
	}
	
	public static boolean chaChong(int x,int y) {
		if(x == y)
			return false;
		else
			return true;
	}
	
	public static void main(String[] args) {
		int n = 0,k = 0;
		int a1[] = new int[36];  //数组元素初值为0
		int a2[] = new int[13];
		System.out.println("欢迎使用大乐透,本期号码如下");
		System.out.print("前区号码:");
		do {
			n = getRandom1();  //产生随机整数
			if(chaChong(a1[n],n)) {  //排除产生的重复号码
				a1[n] = n;
				k++;     //计数器 统计前区号码数量
				System.out.print(n + " ");
			}
		
		}while(k < 5);
		k = 0;  //计数器复位
		System.out.print("\n后区号码:");
		do {
			n = getRandom2();
			if(chaChong(a2[n],n)) {
				a2[n] = n;
				k++;
				System.out.print(n + " ");
			}
		
		}while(k < 2);
		System.out.print("\n /| /   _ _  _  _  _ \r\n" + 
				"/ |/_// / //_ |/ //_'\r\n" + 
				"   _/         ");
	}
}