(C++)英語(yǔ)抽背點(diǎn)名器源程序-V1.1.1
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,linshi,total[100]={0},miss;
long long key;
bool bj[100]={true};
string name[200];
cout<<"(如需查看更新日志,請(qǐng)?jiān)诿荑€欄輸入‘0’)"<<endl<<endl;
cout<<"請(qǐng)輸入隨機(jī)的八位數(shù)字密鑰:";
cin>>key;
if(key==0){
cout<<"現(xiàn)行版本:1.1.1"<<endl<<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)計(jì)'的功能" <<endl;
cout<<"將結(jié)尾等待時(shí)間從100秒改至99999秒"<<endl<<endl;
cout<<"(2023-1-15)update-1.1.0:"<<endl;
cout<<"引入'密鑰',通過(guò)一定算法(動(dòng)態(tài)數(shù)+常數(shù))在不更換名單順序的情況下實(shí)現(xiàn)不同次序"<<endl;
cout<<"加入'更新日志'"<<endl;
cout<<"將抽背完成后等待時(shí)間從99999秒改至999秒,減少非必要的內(nèi)存消耗,加入時(shí)間提示"<<endl;
cout<<"解決'特殊位置無(wú)法抽到'的問(wèn)題"<<endl;?
cout<<"微量?jī)?yōu)化UI,在姓名間加入換行,使姓名更易讀取"<<endl<<endl;
cout<<"(2022-1-19)update-1.1.1:"<<endl;
cout<<"簡(jiǎn)化了簡(jiǎn)單計(jì)算的寫(xiě)法,減少運(yùn)行內(nèi)存"<<endl;
cout<<"將站立標(biāo)記的定義類(lèi)型從int改為bool"<<endl<<endl;
cout<<"(120秒后自動(dòng)關(guān)閉)";
_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+=1;}
if(linshi>a){linshi-=a;}
if(linshi==0){linshi=a;}
cout<<endl;
cout<<i<<"."<<name[linshi]<<endl;
cout<<"分?jǐn)?shù)決定(1或-1):";
cin>>c;
if(c==0){break;}
if(c==1){bj[linshi]=true;}
if(c==-1){bj[linshi]=false;b+=1;}
total[linshi]+=c;
miss=linshi;}
cout<<endl<<endl<<"分?jǐn)?shù)統(tǒng)計(jì):"<<endl;
for(int i=1;i<=a;i++){
if(bj[i]==false){cout<<"(站立中)";}
else{cout<<"? ? ? ? ";}
cout<<name[i]<<" "<<total[i]<<endl;}
cout<<endl<<"999秒后自動(dòng)關(guān)閉";?
_sleep(999999);
return 0;}