《C++》21点扑克牌游戏程序 - 图文(6)

2019-04-02 19:55

}

}

}

ShowStatus(0); while(GetTotalScore(hands[0],numOfCard[0])<=16) { hands[0][numOfCard[0]++]=DealOneCard(); ShowStatus(0);

}

cout<

if(GetTotalScore(hands[0],numOfCard[0])>21) { for (i=1;i<=numOfPlayer;i++) { if(GetTotalScore(hands[i],numOfCard[i])<=21) {

cout<

Pla[i].sl++;

Pla[i].money=Pla[i].money+Pla[i].yq;

Pla[0].money=Pla[0].money-Pla[i].yq; } else { cout<

}

}

} else {

for (i=1;i<=numOfPlayer;i++)

26

if(GetTotalScore(hands[i],numOfCard[i])<=21 &&

GetTotalScore(hands[i],numOfCard[i])>GetTotalScore(hands[0],numOfCard[0]))

{

cout<

Pla[i].sl++;

Pla[i].money=Pla[i].money+Pla[i].yq;

Pla[0].money=Pla[0].money-Pla[i].yq; }

else

(GetTotalScore(hands[i],numOfCard[i])==GetTotalScore(hands[0],numOfCard[0])) { cout<

} else { cout<

Pla[i].money=Pla[i].money-Pla[i].yq;

Pla[0].money=Pla[0].money+Pla[i].yq;

}

}

int bz=0,k=0;

for(i=1;i<=numOfPlayer;i++) { if(Pla[i].money<=0) {

bz=1;

k=i;

cout<

}

27

if

if(Pla[0].money>0) { if(bz==0) { for(int x=0;x<=numOfPlayer;x++)

cout<

goto ks;

}

if(bz==1)

{

for(int x=0;x<=numOfPlayer;x++) { cout<

}

for(int p=1;p<=numOfPlayer;p++) { cout<

}

}

} else { for(int x=0;x<=numOfPlayer;x++) { cout<

cout<<\我是特意输给你们的,就当叔叔我给你们的压岁钱!\

{

cout<

28

for(int p=1;p<=numOfPlayer;p++)

cout<<\局\平了\局\ } #endif

utility.h // 实用程序工具包 }

}

#ifndef __UTILITY_H__ #define __UTILITY_H__ #ifdef _MSC_VER

#if _MSC_VER == 1200

// 标准库头文件 #include #include #include #include

#include #include

#include

#include #include

#include #include #include

#else

// ANSI C++标准库头文件 #include

#include #include #include

// 表示是Visual C++

表示Visual C++6.0

// 标准串和操作 // 标准流操作 // 极限

数据函数 文件输入输出 // 字符处理

日期和时间函数 // 标准库 // 标准输入输出

输入输出流格式设置 支持变长函数参数 // 支持断言

其它版本的Visual C++

标准串和操作 // 标准流操作

极限 数据函数

29

//

// // //

// //

// //

// // #include #include

// 文件输入输出

// 字符处理

// 日期和时间函数 // 标准库

#include #include

#include #include

// 标准输入输出

// 输入输出流格式设置 // 支持变长函数参数 // 支持断言

#include #include

using namespace std; #endif #else

// 标准库包含在命名空间std中 // _MSC_VER == 1200

// 非Visual C++

// ANSI C++标准库头文件 #include

// 标准串操作

// 标准流操作

#include #include #include #include #include

// 极限 // 数据函数

// 文件输入输出

// 字符处理

// 日期和时间函数 // 标准库

#include #include

#include #include

// 标准输入输出

// 输入输出流格式设置 // 支持变长函数参数 // 支持断言

#include #include

using namespace std; #endif

// 实用函数

// 标准库包含在命名空间std中 // _MSC_VER

char GetChar(istream &inStream = cin);// 从输入流inStream中跳过空格及制表符获取一字符

30


《C++》21点扑克牌游戏程序 - 图文(6).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:仓泵二期技术条件

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: