谁能帮我检查一下这些代码的错误?

来源:百度知道 编辑:UC知道 时间:2024/09/23 17:21:09
#include <cstdlib>
#include <iostream>
#include <windows.h>

using namespace std;
void delay(int second)//time delay function
{
int timer=time(0);
while(timer!=(time(0)-second))
time(0);
}

void setcolor(unsigned short colour)//setcolour
{
HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hcon,colour);
return;
}

void gotoxy(short x, short y) //Bottom right corner is (79,24)
{
HANDLE hStdout=GetStdHandle(STD_OUTPUT_HANDLE);
COORD position={x,y};
SetConsoleCursorPosition(hStdout, position);
}

int randGenerator(int max, int min)//Random number generator
{
int randomNumber=rand()%(max-min+1)+min;
return randomNumber;
}

class icon
{
private:
int color;
char symbol;
int x;
int y;
public:
void setColor(int newCol

#include <cstdlib>
#include <iostream>
#include <windows.h>
#include <time.h> /* time函数的头文件 */

using namespace std;
void delay(int second)//time delay function
{
int timer=time(0);
while(timer!=(time(0)-second))
time(0);
}

void setcolor(unsigned short colour)//setcolour
{
HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hcon,colour);
return;
}

void gotoxy(short x, short y) //Bottom right corner is (79,24)
{
HANDLE hStdout=GetStdHandle(STD_OUTPUT_HANDLE);
COORD position={x,y};
SetConsoleCursorPosition(hStdout, position);
}

int randGenerator(int max, int min)//Random number generator
{
int randomNumber=rand()%(max-min+1)+min;
return randomNumber;
}

class icon
{
public: /* 改成public, 不然后面没法付值的 */
int color;
char symbol