#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <ctime>
using namespace std;
enum{
SPADES,
HEARTS,
CLUBS,
DIAMONDS,
JOKER
};
//全局变量 g_ 局部静态变量s_ 成员变量m_
class Poker
{
char m_type;//花色
int m_point;//点数
public:
Poker() :
m_type(0),
m_point(0)
{}
Poker(char type, int point) :
m_type(type),
m_point(point)
{}
void makePoker(char type,int point)
{
m_type = type;
m_point = point;
if (m_type == JOKER)
{
m_point += 13;
}
}
void outputPoker()
{
char *type[5] = { "黑桃", "红桃", "梅花", "方片", " " };
char *point[16] = { " ", "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K", "小王", "大王" };
printf("%s%s", type[m_type], point[m_point]);
}
bool cmppoker(Poker tmp)
{
return (m_point<t
模拟发三人牌——C++
最新推荐文章于 2023-01-02 15:00:58 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)