(C++)英語抽背點名器源程序-V1.1.0
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,linshi,total[100]={0},bj[100]={0},miss;
long long key;
string name[200];
cout<<"(如需查看更新日志,請在密鑰欄輸入‘0’)"<<endl<<endl;
cout<<"請輸入隨機的八位數(shù)字密鑰:";
cin>>key;
if(key==0){
cout<<"現(xiàn)行版本:1.1.0"<<endl;
cout<<"更新日志:"<<endl;
cout<<"(2022-12-14)update-1.0.0:"<<endl;
cout<<"系統(tǒng)初步建立"<<endl<<endl;
cout<<"(2022-12-17)update-1.0.1:"<<endl;
cout<<"加入'中止抽背并統(tǒng)計'的功能" <<endl;
cout<<"將結尾等待時間從100秒改至99999秒"<<endl<<endl;
cout<<"(2023-1-15)update-1.1.0:"<<endl;
cout<<"引入'密鑰',通過一定算法(動態(tài)數(shù)+常數(shù))在不更換名單順序的情況下實現(xiàn)不同次序"<<endl;
cout<<"加入'更新日志'"<<endl;
cout<<"將結尾等待時間從99999秒改至999秒,減少非必要的內存消耗,加入微量時間提示"<<endl;
cout<<"解決'特殊位置無法抽到'的問題"<<endl;?
cout<<"微量優(yōu)化UI,在姓名間加入換行,使姓名更易讀取"<<endl<<endl;
cout<<"(120秒后自動關閉)";
_sleep(120000);
return 0;
}
cout<<"輸入人數(shù)及姓名:";
cin>>a;
for(int i=1;i<=a;i++){
cin>>name[i];}
cout<<endl<<"輸入抽背人數(shù):";
cin>>b;
cout<<"按'0'以停止"<<endl;
_sleep(2000);
for(int i=1;i<=b;i++){
linshi=(key/202+rand()%a+14+b*7)%a;
if(linshi==miss){linshi=linshi+1;}
if(linshi>a){linshi=linshi-a;}
if(linshi==0){linshi=a;}
cout<<endl;
cout<<i<<"."<<name[linshi]<<endl;
cout<<"分數(shù)決定(1或-1):";
cin>>c;
if(c==0){break;}
if(c==1){bj[linshi]=0;}
if(c==-1){bj[linshi]=1;b=b+1;}
total[linshi]=total[linshi]+c;
miss=linshi;}
cout<<endl<<endl<<"分數(shù)統(tǒng)計:"<<endl;
for(int i=1;i<=a;i++){
if(bj[i]==1){cout<<"(站立中)";}
else{cout<<"? ? ? ? ";}
cout<<name[i]<<" "<<total[i]<<endl;}
cout<<endl<<"999秒后自動關閉";?
_sleep(999999);
return 0;}