CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - static color
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Sub Category
assembly language
SCSI-ASPI
ELanguage
Disk Tools
Speech/Voice recognition/combine
Editor
Anti-virus
MultiLanguage
MPI
source in ebook
Delphi VCL
OS Develop
MiddleWare
MacOS develop
LabView
e-language
python
Search - static color - List
[
assembly language
]
O5
DL : 0
1,定义一个类Card,该类的对象代表一张扑克牌。要求包含三个属性:点数,花色,和大小王信息(三者均为enum类型)。要求扑克牌能比较大小,比较规则为: a,大王最大,小王其次。 b,其他的扑克牌按点数大小来比,点数相同的按花色来比(花色从大到小的顺序是:黑桃>红桃>梅花>方块)。 2,为Card类写一个静态方法: static TreeSet[] dispatch(int players,int reservers),要求用一副扑克牌随机的为多人发牌,并预留给定张数的底牌,返回一个TreeSet数组,保存排好序的每个玩家得到的牌,以及预留的底牌。 3,写一个主方法测试以上程序,输出每次发牌的结果。 -define a class Card, the class object represents a playing card. Requirement contains three attributes: points, color, and size of the king of information (three are enum types.) Asked to compare the size of playing cards, more rules: a, King largest, followed by Wang. b, other than poker size in points, points to the same than by color (color in sequence are: spades> hearts> plum> box). 2, for the Card class to write a static method: static TreeSet [] dispatch (int players, int reservers), require more than a deck of cards for the licensing of random, and set aside a given number of sheets of the cards, return an array of TreeSet, save the sorted each player get the card, and set aside the cards. 3, write a main method to test the above procedure, the output results of each license.
Date
: 2025-12-23
Size
: 2kb
User
:
盒子
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.