cardplaying.java
来自「模拟了N个人玩扑克牌时发放牌」· Java 代码 · 共 39 行
JAVA
39 行
package usededclass;
/**
* <p>Title: </p>
* <p>Description: </p>
* <p>Copyright: Copyright (c) 2005</p>
* <p>Company: </p>
* @author not attributable
* @version 1.0
*/
public class CardPlaying extends XiaoFan
{
public static void main(String[] args)
{
System.out.println("Please enter the numbers of players");
int number=readInt();
CardDeck allCards=new CardDeck();
allCards.shuffle();
for(int i=0;i<number;i++)
{
int n=54/number;
int m=54%number-i;
if(m>0)
n = n + 1;
Hand palyer1=allCards.distributeCard(n);
String str="palyer";
int j=i;
j++;
str=str+j;
System.out.println("The cards of"+str+" are follows");
palyer1.showCards();
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?