用java来模拟抢手气红包,多线程
在上一个模拟微信抢红包的基础上,添加多线程
代码
import java.math.BigDecimal;
import java.util.Scanner;
public class qianhoubao {
public static void main(String[] args) {
System.out.println("-----模拟微信发拼手气红包-----");
Scanner sc = new Scanner(System.in);
System.out.println("请输入所发红包的总金额");
double money= sc.nextDouble();
System.out.println("请输入群成员个数");
int people = sc.nextInt();
String[] name = new String[people];
for (int i=0;i<people;i++){
System