(C++)英语抽背点名器源程序-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<<"(如需查看更新日志,请在密钥栏输入‘0’)"<<endl<<endl;
cout<<"请输入随机的八位数字密钥:";
cin>>key;
if(key==0){
cout<<"现行版本:1.1.1"<<endl<<endl;
cout<<"更新日志:"<<endl;
cout<<"(2022-12-14)update-1.0.0:"<<endl;
cout<<"系统初步建立"<<endl<<endl;
cout<<"(2022-12-17)update-1.0.1:"<<endl;
cout<<"加入'中止抽背并统计'的功能" <<endl;
cout<<"将结尾等待时间从100秒改至99999秒"<<endl<<endl;
cout<<"(2023-1-15)update-1.1.0:"<<endl;
cout<<"引入'密钥',通过一定算法(动态数+常数)在不更换名单顺序的情况下实现不同次序"<<endl;
cout<<"加入'更新日志'"<<endl;
cout<<"将抽背完成后等待时间从99999秒改至999秒,减少非必要的内存消耗,加入时间提示"<<endl;
cout<<"解决'特殊位置无法抽到'的问题"<<endl;
cout<<"微量优化UI,在姓名间加入换行,使姓名更易读取"<<endl<<endl;
cout<<"(2022-1-19)update-1.1.1:"<<endl;
cout<<"简化了简单计算的写法,减少运行内存"<<endl;
cout<<"将站立标记的定义类型从int改为bool"<<endl<<endl;
cout<<"(120秒后自动关闭)";
_sleep(120000);
return 0;
}
cout<<"输入人数及姓名:";
cin>>a;
for(int i=1;i<=a;i++){
cin>>name[i];}
cout<<endl<<"输入抽背人数:";
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<<"分数决定(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<<"分数统计:"<<endl;
for(int i=1;i<=a;i++){
if(bj[i]==false){cout<<"(站立中)";}
else{cout<<" ";}
cout<<name[i]<<" "<<total[i]<<endl;}
cout<<endl<<"999秒后自动关闭";
_sleep(999999);
return 0;}