admin管理员组

文章数量:1532496

2024年1月14日发(作者:)

{ x = rand() % (n + 1); while (x != 0 && (player[x].life == 0 || x == i)) { Sleep(rand() % 98); srand(time(0)); x = rand() % (n + 1); } if (x == 0) cout << i << "号玩家弃权" << endl; else cout << i << "号玩家投给了" << x << "号玩家" << endl; } } if (x != 0) TOU[x].xxx++; } } Sleep(3000); sort(TOU + 1, TOU + n + 1, cmp); if (TOU[2].xxx != TOU[1].xxx) { cout << "投票结束," << TOU[1].num << "号投票出局" << endl; player[TOU[1].num].life = 0; player[TOU[1].num].how = 2; Sleep(3000); return; } else { TOU[1].toupiaoquan = 0; TOU[2].toupiaoquan = 0; system("cls"); print(ddd, nnn); cout << TOU[1].num << "号," << TOU[2].num << "号"; int i; for (i = 3; i <= n; i++) { if (TOU[i].xxx == TOU[1].xxx) { TOU[i].toupiaoquan = 0; cout << "," << TOU[i].num << "号"; } else break; } if (i == n + 1) { for (int i = 1; i <= n; i++) TOU[i].toupiaoquan = 1; } cout << "平票" << endl; } //--------2-------- sort(TOU + 1, TOU + n + 1, cmp1);

{ x = rand() % (n + 1); while (x != 0 && (player[x].life == 0 || x == i || TOU[x].toupiaoquan == 1)) { srand(time(0)); x = rand() % (n + 1); } if (x == 0) cout << i << "号玩家弃权" << endl; else cout << i << "号玩家投给了" << x << "号玩家" << endl; } } if (x != 0 && TOU[i].toupiaoquan == 1) TOU[x].xxx++; } } Sleep(3000); sort(TOU + 1, TOU + n + 1, cmp); if (TOU[2].xxx != TOU[1].xxx) { cout << "投票结束," << TOU[1].num << "号投票出局" << endl; player[TOU[1].num].life = 0; player[TOU[1].num].how = 2; Sleep(3000); return; } else { TOU[1].toupiaoquan = 0; TOU[2].toupiaoquan = 0; system("cls"); print(ddd, nnn); cout << TOU[1].num << "号," << TOU[2].num << "号"; int i; for (i = 3; i <= n; i++) { if (TOU[i].xxx == TOU[1].xxx) { TOU[i].toupiaoquan = 0; cout << "," << TOU[i].num << "号"; } else break; } if (i == n + 1) { for (int i = 1; i <= n; i++) TOU[i].toupiaoquan = 1; } cout << "平票" << endl; } //--------3-------- sort(TOU + 1, TOU + n + 1, cmp1); cout << "请再次投票"; for (int i = 1; i <= 3; i++)

#define MOD 28#define SIZE_N 19#define SIZE_M 12

int cur_x,cur_y;int score,mark,next,map[SIZE_N][SIZE_M],Gamespeed=300;

int shape[28][6]={ {0,-1,0,-2,1,0}, {0,1,1,0,2,0}, {-1,0,0,1,0,2}, {0,-1,-1,0,-2,0}, {0,-1,0,1,-1,0}, {0,1,1,0,-1,0}, {1,0,0,-1,0,1}, {1,0,-1,0,0,-1}, {-1,1,0,1,1,0}, {0,-1,1,0,1,1}, {-1,0,0,-1,1,-1}, {-1,-1,-1,0,0,1}, {-1,0,0,1,1,1}, {0,1,1,-1,1,0}, {-1,0,0,1,1,1}, {0,1,1,-1,1,0}, {-1,0,0,-1,0,-2}, {-1,0,-2,0,0,1}, {0,1,0,2,1,0}, {0,-1,1,0,2,0}, {0,1,1,0,1,1}, {0,-1,1,0,1,-1}, {-1,0,0,-1,-1,-1}, {-1,0,-1,1,0,1}, {0,1,0,2,0,3}, {1,0,2,0,3,0}, {0,-1,0,-2,0,-3}, {-1,0,-2,0,-3,0}};

void gotoxy(int x,int y){ COORD c; c.X=x-1; c.Y=y-1; SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);}void Gameover(){ int i,j,flag=0; for(j=1;j

if(map[ x+shape[id][i] ][ y+shape[id][i+1] ]!=0)return 0; }return 1;}

void fun_score(){ int i,j,ii,jj; for(i=1;i1;ii--){ for(jj=1;jj

int main(){ int i,id,set=1;

srand(time(NULL)); id=rand()%MOD; id=(id+MOD)%MOD; next=rand()%MOD; next=(next+MOD)%MOD;

init(id);

while(1){Here: mark=0; if(set==0){ id=next; next=rand()%MOD; next=(next+MOD)%MOD; cur_x=0;cur_y=5; set=1; }

while(!kbhit()){ Gameover(); if(judge_in(cur_x+1,cur_y,id)==1) cur_x++; else { map[cur_x][cur_y]=2;

break; } } } return 0;}

本文标签: 玩家投票集结免费源码