求C++高中编写程序!!!!!!

来源:百度知道 编辑:UC知道 时间:2024/05/17 08:47:51
英文的,题目如下:
A common memory matching game played by young children is to start with a deck of cards that contain identical pairs. For example, given six cards in the deck, two might be labeled ‘1’, two might be labeled ‘2’, and two might be labeled ‘3’. The cards are shuffled and placed face down on the table. The player then selects two cards that are face down and turns them face up, and if they match they are left face up. If the two cards do not match, they are return to their original position face down, the game continues in this fashion until all cards are face up.

Write a program that plays the memory matching game. Use 16 cards that are laid out in a 4×4 square and labeled with pairs of numbers from 1 to 8. Your program should allow the player to specify the cards that she or he would like to select through a coordinate system.

For example: suppose the cards are in the following layout:

1 2 3

玩家选择两张面朝下的牌,然后翻过来。如果这两张是一对,那么就让这两张翻过来。如果它们不是一对,就让它们就继续面朝下。
外语和程序一样简单.
这种题目用图形界面做好点,没有难度.

你要是真给200分我帮你做个,当然只做4*4格子的.

//// 楼主,说话可要算话哦,自己运行程序看看,是不是和你要求一模一样.......
#include<iostream>
#include<algorithm>
#include<ctime>
#include <vector>
#include <conio.h>

#define MAX_COUNT 4

using namespace std;

class Card
{
public:
Card()
{
m_iData = 0;
m_bShow = false;
m_bUp = false;
}
int m_iData; // 牌面值
bool m_bShow; // 配对成功彻底翻开
bool m_bUp; // 游戏过程中的翻牌
};

/// 打印出牌的排列
void PrintCards(vector<Card*> &arrayCards)
{
system("cls");
int i = 0;
// 打印编号
for (i = 1 ; i <= MAX_COUNT ; i ++)
{
cout << "\t" << i;
}
cout << endl;
int iCount = 0;
for (i = 0 ; i < MAX_COUNT ; i ++)