1、import java.util.Arrays;import java.util.Scanner;import java.util.Random;public class CardsDemoLevel public static void main(String args) /1、导入对应的类 Scanner,生命并实例化Scanner input = new Scanner(System.in);/2、友好提示System.out.println(“请输入玩家个数:“);/从控制台得到玩家的个数,Integer.parseInt(input.next();int players = inpu
2、t.nextInt();/对输入的数据进行合理化的验证while(players52)System.out.println(“您输入数据不合法,牌不够发的!“);else/发牌后,每个玩家的牌int playerCards = dispatch(players,pCards);for (int k = 0; k =3)/定义一个存放牌的花色的数组int color = new int3;for (int i = 0; i color.length; i+) colori = cardsi/100;/定义一个存放三张牌的点数的数组int size = new int3;for (int j = 0; j size.length; j+) sizej = cardsj%100;/将三张的点数进行排序Arrays.sort(size);if(size0=size1else if(color0=color1elselevel = 4;else if(size0+1=size1)else if(size0=size1|size1 = size2)level = 2;elselevel = 1;return level;