代码实现:
import java.util.Random;
import java.util.Scanner;
//双色球判断是否中奖系统
public class Text1 {
public static void main(String[] args) {
int[] arr1 = product();
int[] arr2 = newArr();
int first = pD(arr1,arr2);
int last = pDlast(arr1,arr2);
System.out.println("相同红号的次数:" + first);
System.out.println("相同蓝号的次数:" + last);
money(first,last);
}
//判断是否数组中有重复元素
public static boolean penD(int[] arr,int num) {
for (int x:arr) {
if(x == num){
return true;
}
}
return false;
}
//随机大印双色球出奖号码