最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

(C++)英語抽背點名器源程序-V1.3.0

2023-01-22 00:02 作者:進(jìn)擊的水瓶  | 我要投稿

#include<bits/stdc++.h>

using namespace std;//固定格式


int main(){?

int a,b,c,linshi,miss;

long long key;

struct test{

int total;

bool bj;

string name;

}data[100];//數(shù)據(jù)的類型聲明?


for(int i=0;i<=100;i++){

data[i].total=0;

data[i].bj=true;}


cout<<"(如需查看更新日志,請在密鑰欄輸入‘0’)"<<endl<<endl;

cout<<"請輸入隨機的八位數(shù)字密鑰:";

cin>>key;


if(key==0){

cout<<"現(xiàn)行版本:1.3.0"<<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)計'的功能" <<endl;

cout<<"將結(jié)尾等待時間從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秒,減少非必要的內(nèi)存消耗,加入時間提示"<<endl;

cout<<"解決'特殊位置無法抽到'的問題"<<endl;?

cout<<"微量優(yōu)化UI,在姓名間加入換行,使姓名更易讀取"<<endl<<endl;


cout<<"(2022-1-19)update-1.1.1:"<<endl;

cout<<"簡化了簡單計算的寫法,減少運行內(nèi)存"<<endl;

cout<<"將站立標(biāo)記的定義類型從int改為bool"<<endl<<endl;


cout<<"(此正式版未發(fā)布)update-1.2.0:"<<endl;

cout<<"完全改變數(shù)據(jù)的結(jié)構(gòu),用結(jié)構(gòu)體data整合原變量,使程序結(jié)構(gòu)更清晰"<<endl;

cout<<"抽背人數(shù)上限定為100人,減少存儲空間"<<endl<<endl;


cout<<"(2023-1-21)update-1.3.0:"<<endl;

cout<<"加入數(shù)據(jù)的排序功能(冒泡排序),在輸出時按需輸出"<<endl;

cout<<"將程序源文件分段處理并加入注釋,便于理解和改寫"<<endl<<endl;


cout<<"如有發(fā)現(xiàn)功能異常,請及時聯(lián)系作者"<<endl;

cout<<"(120秒后自動關(guān)閉)";

_sleep(120000);

return 0;//結(jié)束?

}//更新日志?



cout<<"輸入人數(shù)及姓名:";

cin>>a;

for(int i=1;i<=a;i++){cin>>data[i].name;}

cout<<endl<<"輸入抽背人數(shù):";

cin>>b;

cout<<"按'0'以停止"<<endl;

_sleep(2000);//人數(shù),名字的輸入?


for(int i=1;i<=b;i++){

linshi=(key/202+rand()%a+14+b*7)%a;//取隨機數(shù)?


if(linshi==miss){linshi+=1;}

if(linshi>a){linshi-=a;}

if(linshi==0){linshi=a;}

cout<<endl;

cout<<i<<"."<<data[linshi].name<<endl; //抽背功能實現(xiàn)核心部分?


cout<<"分?jǐn)?shù)決定(1或-1,0為中止并統(tǒng)計)";

cin>>c;

if(c==0){break;}

if(c==1){data[linshi].bj=true;}

if(c==-1){data[linshi].bj=false;b+=1;}

data[linshi].total+=c;

miss=linshi;}//miss令,分?jǐn)?shù)計算,標(biāo)記?


for(int i=2;i<=a;i++){

for(int j=2;j<=a;j++){

if(data[j-1].total<data[j].total){

swap(data[j-1].name,data[j].name);

swap(data[j-1].bj,data[j].bj);

swap(data[j-1].total,data[j].total);}}}//排序功能?


cout<<endl<<endl<<"分?jǐn)?shù)統(tǒng)計:"<<endl;

for(int i=1;i<=a;i++){

if(data[i].bj==false){cout<<"(站立中)";}

else{cout<<"? ? ? ? ";}

cout<<data[i].name<<" "<<data[i].total<<endl;}

cout<<endl<<"999秒后自動關(guān)閉";?

_sleep(999999);//按序輸出

?

return 0;}

(C++)英語抽背點名器源程序-V1.3.0的評論 (共 條)

分享到微博請遵守國家法律
大石桥市| 通州市| 大竹县| 陈巴尔虎旗| 台湾省| 四平市| 伊通| 鹿泉市| 延吉市| 当阳市| 甘泉县| 炎陵县| 开封市| 东源县| 开平市| 江永县| 无棣县| 乐安县| 平度市| 武义县| 北票市| 霍邱县| 固镇县| 清水河县| 通江县| 翁牛特旗| 大新县| 海门市| 金山区| 乐亭县| 青岛市| 望奎县| 乐东| 马尔康县| 辛集市| 宁国市| 古浪县| 新乡县| 苗栗县| 沂水县| 丰原市|