c++游戏编程100事列_C++编程实例100篇【实例简介】C 编程源程序100个,由易到难,⾥⾯有很多很基础的编程实例,可以作为参考,适合于初学者。
【实例截图】
【核⼼代码】
//THE PROGRAM IS TO DISPLAY THE OPREATING SYSTEM'S
//PROCESS PAGE DISTRIBUTE.
//FILE PAGE.CPP
#include
i can#include
#include
#include
#include
#define MAX 100
#define Count 5
int TableLength,Virtual[MAX];
int Length[Count],Privilege[Count];
int Normal[Count],IOTime[Count],Finish[Count];
void Kernel(void);
void Result(void);
void Version(void);
int IF_Finish(void);
void InitGrid(void);
void InitGraph(void);
void InitRecord(void);
void InitProcess(void);
class Node
{
private :
int ID;
int Length;
int Privilege;
int Temp[MAX];
public :
Node()
{
for (int i=0;i
}
void SetID(int I)
过去完成时练习题及答案
{
ID=I;
}
void SetLength(int L)
{cannonball
Length=L;
}
void SetPrivilege(int P)
分钟用英语怎么说
{
Privilege=P;
}
void SetPosition(int Order)
{
Virtual[Order]=ID;
Temp[Order]=ID;
}
void Relea(void)
{
for (int i=0;i
if (Virtual[i]==ID)
{
Virtual[i]=-1;
Graph.GetRectangle(i)->Fill(0);
}
丧气近义词
}
int GetID(void){return ID;}
int GetLength(void){return Length;}
int GetPrivilege(void){return Privilege;}
int GetPosition(void)
{
for (int i=0;i
{
if (Temp[i]==ID) break;
}
if (Temp[i]==-1) return MAX; el
{
Temp[i]=-1;
return i;
}
}
};
class Rectangle
{
friend class Grid;
private :
int left,top,right,bottom;
char content[50];
public :
四级证书编号查询void Outtextxy(char text[50])
{
strcpy(content,text);
outtextxy(left 9,top 7,content); }
void Fill(int Number)
{
be cooltfillstyle(SOLID_FILL,Number); bar3d(left,top,right,bottom,0,0); getch();
}
void Test(int Temp,int Interval) {
if (Temp==0) outtextxy(left 45 Interval,top 7,"0"); if (Temp==1) outtextxy(left 45 Interval,top 7,"1"); if (Temp==2) outtextxy(left 45 Interval,top 7,"2"); if (Temp==3) outtextxy(left 45 Interval,top 7,"3"); if (Temp==4) outtextxy(left 45 Interval,top 7,"4"); if (Temp==5) outtextxy(left 45 Interval,top 7,"5"); if (Temp==6) outtextxy(left 45 Interval,top 7,"6"); if (Temp==7) outtextxy(left 45 Interval,top 7,"7"); if (Temp==8) outtextxy(left 45 Interval,top 7,"8"); if (Temp==9) outtextxy(left 45 Interval,top 7,"9"); }
void Display(int number)
{
int Temp=number;
if ((Temp>=0) && (Temp<=9))
{
Test(Temp,0);
}
if ((Temp>=10) && (Temp<=99))
{
qsiTemp=int (Temp/10);
Test(Temp,0);
Temp=number-Temp*10;
Test(Temp,5);
}
}
};
class Grid
{
private :
Rectangle *Array[100];
public :
Grid(){};
void NewRectangle(int number,int a,int b,int c,int d)
{
Rectangle *Newrect;
Newrect=new Rectangle;
Newrect->left=a;
Newrect->top=b;
Newrect->right=c;
Newrect->bottom=d;
rectangle(a,b,c,d);
Array[number]=Newrect;
回音echo
}
Rectangle *GetRectangle(int number) {
return Array[number];
}
};
barbaric
Grid Record,Graph;
Node Table[50];
int main(void)
{
InitProcess();
getch();
InitGraph();
InitRecord();
InitGrid();
Kernel();
Result();
Version();
getch();
clograph();
return 0;
}
void InitProcess(void)
{
int i;