#include<bits/stdc++.h> string zhs[10005],mms[10005],c[10005],gx[10005],nowzh,nowmm,nowgxqm; long long jss=0,nj=0; //登录 bool dl(){ cout<<“请输入账号:”; string zh; cin>>zh; cout<<“请输入密码:”; string mm; cin>>mm; for(int i=0;i<jss;i++){ if(zh==zhs[i]&&mm==mms[i]){ nowzh=zh; nowmm=mm; nowgxqm=gx[i]; return 1; } } return 0; } //注册 void zc(){ cout<<“请输入账号:”; cin>>zhs[jss]; cout<<“请输入密码:”; cin>>mms[jss]; cout<<“请输入个性签名:”; cin>>gx[jss]; cout<<“注册成功!”; jss++; } //登陆成功后的一系列操作 void dlcg(){ while(1){ cout<<“输入1:查看个人信息”<<endl<<“输入2:查看课外单词表”<<endl<<“输入3:课外单词默写”<<endl<<“输入4:退出登录”<<endl<<“输入5:修改密码”<<endl<<“输入6:单词排序”<<endl<<“输入7:查看课内单词”<<endl<<“输入8:查看错题本”<<endl<<“输入9:修改个性签名”<<endl; int n=0; cin>>n; //查看个人信息 if(n==1){ system(“cls”); cout<<“账号:“<<nowzh<<endl<<“密码:“<<nowmm<<endl<<“个性签名:“<<nowgxqm<<endl; }//查看单词表 if(n==2){ system(“cls”); cout<<“请问要查看几年级的常用单词?(1-8)”; int www=0; cin>>www; if(www==1||www==2||www==3){ cout<<“要查什么类型?(数字、颜色、动物、家庭成员、日常用品、食物、身体部位、动作)”; string lx; cin>>lx; system(“cls”); cout<<“1-3年级基础词汇->“<<lx<<”:“<<endl; if(lx==“数字”){ string sz[15]={” one”,” two”,” three”,” four”,” five”,” six”,” seven”,” eight”,” nine”,” ten”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“颜色”){ string sz[15]={” red”,” blue”,” yellow”,” green”,” orange”,” purple”,” black”,” white”,” pink”,” brown”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“动物”){ string sz[15]={” cat”,” dog”,” bird”,” fish”,” rabbit”,” lion”,” tiger”,” elephant”,” monkey”,” cow”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“家庭成员”){ string sz[15]={” father”,” mother”,” brother”,” sister”,” grandma”,” grandpa”,” uncle”,” aunt”}; for(int i=0;i<8;i++)cout<<sz[i]<<endl; } else if(lx==“日常用品”){ string sz[15]={” book”,” pen”,” pencil”,” desk”,” chair”,” table”,” bag”,” cup”,” plate”,” spoon”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“食物”){ string sz[15]={” apple”,” banana”,” bread”,” milk”,” egg”,” rice”,” water”,” cake”,” juice”,” meat”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“身体部位”){ string sz[15]={” head”,” eye”,” nose”,” mouth”,” ear”,” hand”,” arm”,” leg”,” foot”,” toe”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“动作”){ string sz[15]={” run”,” jump”,” walk”,” eat”,” drink”,” sleep”,” play”,” read”,” write”,” sing”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else{ cout<<“当前词库不包含此类别”; } cout<<“按下任意键:继续”<<endl; int wwwn=0; cin>>wwwn; system(“cls”); } if(www==4||www==5||www==6){ cout<<“要查什么类型?(天气、季节、交通工具、职业、学校科目、自然景物、形容词、动词)”; string lx; cin>>lx; system(“cls”); cout<<“4-6年级扩展词汇->“<<lx<<”:“<<endl; if(lx==“天气”){ string sz[15]={” sunny”,” rainy”,” cloudy”,” windy”,” snowy”,” hot”,” cold”,” warm”,” cool”,” stormy”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“季节”){ string sz[15]={” spring”,” summer”,” autumn”,” winter”}; for(int i=0;i<4;i++)cout<<sz[i]<<endl; } else if(lx==“交通工具”){ string sz[15]={” car”,” bus”,” bike”,” train”,” plane”,” ship”,” truck”,” taxi”,” subway”,” boat”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“职业”){ string sz[15]={” teacher”,” doctor”,” nurse”,” farmer”,” driver”,” cook”,” policeman”,” fireman”,” artist”,” student”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“学校科目”){ string sz[15]={” math”,” English”,” science”,” history”,” geography”,” art”,” music”,” PE”,” Chinese”}; for(int i=0;i<9;i++)cout<<sz[i]<<endl; } else if(lx==“自然景物”){ string sz[15]={” tree”,” flower”,” grass”,” river”,” mountain”,” lake”,” sea”,” sky”,” sun”,” moon”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“形容词”){ string sz[15]={” big”,” small”,” tall”,” short”,” long”,” short”,” happy”,” sad”,” angry”,” tired”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“动词”){ string sz[15]={” swim”,” dance”,” climb”,” fly”,” draw”,” cook”,” clean”,” wash”,” study”,” help”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else{ cout<<“当前词库不包含此类别”; } cout<<“按下任意键:继续”<<endl; int wwwn=0; cin>>wwwn; system(“cls”); } if(www==7||www==8){ cout<<“要查什么类型?(国家与城市、节日、科技与工具、情感与性格、反义词、介词、连词、短语与句型)”; string lx; cin>>lx; system(“cls”); cout<<“7-8年级进阶词汇->“<<lx<<”:“<<endl; if(lx==“国家与城市”){ string sz[15]={” China”,” America”,” England”,” Canada”,” Australia”,” Beijing”,” London”,” New York”,” Sydney”,” Tokyo”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“节日”){ string sz[15]={” Christmas”,” Spring Festival”,” Halloween”,” Thanksgiving”,” Easter”,” National Day”}; for(int i=0;i<6;i++)cout<<sz[i]<<endl; } else if(lx==“科技与工具”){ string sz[15]={” computer”,” phone”,” TV”,” camera”,” internet”,” keyboard”,” mouse”,” screen”,” printer”,” robot”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“情感与性格”){ string sz[15]={” excited”,” bored”,” nervous”,” friendly”,” kind”,” brave”,” shy”,” honest”,” funny”,” serious”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“反义词”){ string sz[15]={” hot-cold”,” big-small”,” tall-short”,” happy-sad”,” fast-slow”,” old-young”,” light-dark”}; for(int i=0;i<7;i++)cout<<sz[i]<<endl; } else if(lx==“介词”){ string sz[15]={” in”,” on”,” under”,” behind”,” between”,” next to”,” in front of”,” near”,” above”,” below”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“连词”){ string sz[15]={” and”,” but”,” or”,” because”,” so”,” if”,” when”,” after”,” before”,” while”}; for(int i=0;i<10;i++)cout<<sz[i]<<endl; } else if(lx==“短语与句型”){ string sz[15]={” How are you?”,” What’s your name?”, ” Where are you from?”,” Can you help me?”,” I like…”}; for(int i=0;i<5;i++)cout<<sz[i]<<endl; } else{ cout<<“当前词库不包含此类别”; } cout<<“按下任意键:继续”<<endl; int wwwn=0; cin>>wwwn; system(“cls”); } } //默写单词 if(n==3){ system(“cls”); cout<<“开始默写”; string all[365]={“one”,“two”,“three”,“four”,“five”,“six”,“seven”,“eight”,“nine”,“ten”,“red”,“blue”,“yellow”,“green”,“orange”,“purple”,“black”,“white”,“pink”,“brown”,“cat”,“dog”,“bird”,“fish”,“rabbit”,“lion”,“tiger”,“elephant”,“monkey”,“cow”,“father”,“mother”,“brother”,“sister”,“grandma”,“grandpa”,“uncle”,“aunt”,“book”,“pen”,“pencil”,“desk”,“chair”,“table”,“bag”,“cup”,“plate”,“spoon”,“apple”,“banana”,“bread”,“milk”,“egg”,“rice”,“water”,“cake”,“juice”,“meat”,“head”,“eye”,“nose”,“mouth”,“ear”,“hand”,“arm”,“leg”,“foot”,“toe”,“run”,“jump”,“walk”,“eat”,“drink”,“sleep”,“play”,“read”,“write”,“sing”,“sunny”,“rainy”,“cloudy”,“windy”,“snowy”,“hot”,“cold”,“warm”,“cool”,“stormy”,“spring”,“summer”,“autumn”,“winter”,“car”,“bus”,“bike”,“train”,“plane”,“ship”,“truck”,“taxi”,“subway”,“boat”,“teacher”,“doctor”,“nurse”,“farmer”,“driver”,“cook”,“policeman”,“fireman”,“artist”,“student”,“math”,“English”,“science”,“history”,“geography”,“art”,“music”,“PE”,“Chinese”,“tree”,“flower”,“grass”,“river”,“mountain”,“lake”,“sea”,“sky”,“sun”,“moon”,“big”,“small”,“tall”,“short”,“long”,“short”,“happy”,“sad”,“angry”,“tired”,“swim”,“dance”,“climb”,“fly”,“draw”,“cook”,“clean”,“wash”,“study”,“help”,“China”,“America”,“England”,“Canada”,“Australia”,“Beijing”,“London”,“NewYork”,“Sydney”,“Tokyo”,“Christmas”,“SpringFestival”,“Halloween”,“Thanksgiving”,“Easter”,“NationalDay”,“computer”,“phone”,“TV”,“camera”,“internet”,“keyboard”,“mouse”,“screen”,“printer”,“robot”,“excited”,“bored”,“nervous”,“friendly”,“kind”,“brave”,“shy”,“honest”,“funny”,“serious”,“hot-cold”,“big-small”,“tall-short”,“happy-sad”,“fast-slow”,“old-young”,“light-dark”,“in”,“on”,“under”,“behind”,“between”,“nextto”,“infrontof”,“near”,“above”,“below”,“and”,“but”,“or”,“because”,“so”,“if”,“when”,“after”,“before”,“while”,“How are you?”,“What’syour name?”, “Where are you from?”,“Can you help me? I like…”}; cout<<“请问要默写几个单词?(<=100)”; int nw=0; cin>>nw; for(int i=0;i<nw;i++){ srand(time(0)); int randomNum=rand()%221; cout<<“默写开始:“<<all[randomNum]<<“按下任意键:继续”; Sleep(2000); system(“cls”); cout<<“开始默写:”; string a; cin>>a; if(a==all[randomNum]){ cout<<endl<<“答对了!”; system(“cls”); } else{ cout<<“继续努力!已添加至错题本。”; c[nj]=all[randomNum]; cout<<“正确答案:” <<all[randomNum]; nj++; } }//退出登录 } if(n==4){ system(“cls”); return;
}
//修改密码
if(n==5){
system("cls");
cout<<"请输入新密码:";
string newPassword;
cin >> newPassword;
for (int i=0;i<jss;i++) {
if (nowzh == zhs[i]) {
mms[i] = newPassword;
nowmm = newPassword;
cout << "密码修改成功!" << endl;
break;
}
}
}
//单词排序
if(n==6){
system("cls");
int score=0;
cout<<"单词排序游戏开始"<<endl;
string all[223]={"one","two","three","four","five","six","seven","eight","nine","ten","red","blue","yellow","green","orange","purple","black","white","pink","brown","cat","dog","bird","fish","rabbit","lion","tiger","elephant","monkey","cow","father","mother","brother","sister","grandma","grandpa","uncle","aunt","book","pen","pencil","desk","chair","table","bag","cup","plate","spoon","apple","banana","bread","milk","egg","rice","water","cake","juice","meat","head","eye","nose","mouth","ear","hand","arm","leg","foot","toe","run","jump","walk","eat","drink","sleep","play","read","write","sing","sunny","rainy","cloudy","windy","snowy","hot","cold","warm","cool","stormy","spring","summer","autumn","winter","car","bus","bike","train","plane","ship","truck","taxi","subway","boat","teacher","doctor","nurse","farmer","driver","cook","policeman","fireman","artist","student","math","English","science","history","geography","art","music","PE","Chinese","tree","flower","grass","river","mountain","lake","sea","sky","sun","moon","big","small","tall","short","long","short","happy","sad","angry","tired","swim","dance","climb","fly","draw","cook","clean","wash","study","help","China","America","England","Canada","Australia","Beijing","London","NewYork","Sydney","Tokyo","Christmas","SpringFestival","Halloween","Thanksgiving","Easter","NationalDay","computer","phone","TV","camera","internet","keyboard","mouse","screen","printer","robot","excited","bored","nervous","friendly","kind","brave","shy","honest","funny","serious","hot-cold","big-small","tall-short","happy-sad","fast-slow","old-young","light-dark","in","on","under","behind","between","nextto","infrontof","near","above","below","and","but","or","because","so","if","when","after","before","while"};
cout<<"要给几个单词排序(<=100)"<<endl;
int nw=0;
cin>>nw;
for(int i=0;i<nw;i++){
cout<<endl<<i<<"/"<<score<<endl;
int randomNum=0;
srand(time(0));
randomNum=rand()%221;
string fan=all[randomNum];
Sleep(2000);
sort(fan.begin(),fan.end());
cout<<fan<<endl<<"开始排序:";
string pxh;
cin>>pxh;
if(pxh==all[randomNum]){
cout<<"RIGHT!";
score++;
}
else{
cout<<"继续努力!";
}
cout<<endl;
}
system("cls");
}
//查看课内单词
if(n==7){
system("cls");
cout<<"查看课内单词表:"<<endl;
cout<<"几年级(只支持3-6)"<<endl;
int n=0;
cin>>n;
cout<<"上册还是下册?"<<endl;
string sx;
cin>>sx;
if(sx=="上册"){
if(n==3){
ifstream file("三上.txt");// 检查文件是否成功打开
string line; //逐行读取文件内容
while(getline(file, line))//输出每一行内容
cout<<line<<endl;
file.close();//关闭文件
}
if(n==4){
ifstream file("四上.txt");// 检查文件是否成功打开
string line; //逐行读取文件内容
while(getline(file, line))//输出每一行内容
cout<<line<<endl;
file.close();//关闭文件
}
if(n==5){
ifstream file("五上.txt");// 检查文件是否成功打开
string line; //逐行读取文件内容
while(getline(file, line))//输出每一行内容
cout<<line<<endl;
file.close();//关闭文件
}
if(n==6){
ifstream file("六上.txt");// 检查文件是否成功打开
string line; //逐行读取文件内容
while(getline(file, line))//输出每一行内容
cout<<line<<endl;
file.close();//关闭文件
}
}
if(sx=="下册"){
if(n==3){
ifstream file("三下.txt");// 检查文件是否成功打开
string line; //逐行读取文件内容
while(getline(file, line))//输出每一行内容
cout<<line<<endl;
file.close();//关闭文件
}
if(n==4){
ifstream file("四下.txt");// 检查文件是否成功打开
string line; //逐行读取文件内容
while(getline(file, line))//输出每一行内容
cout<<line<<endl;
file.close();//关闭文件
}
if(n==5){
ifstream file("五下.txt");// 检查文件是否成功打开
string line; //逐行读取文件内容
while(getline(file, line))//输出每一行内容
cout<<line<<endl;
file.close();//关闭文件
}
if(n==6){
ifstream file("六下.txt");// 检查文件是否成功打开
string line; //逐行读取文件内容
while(getline(file, line))//输出每一行内容
cout<<line<<endl;
file.close();//关闭文件
}
}
}
//查看错题本
if(n==8){
system("cls");
if(nj!=0){
cout<<"错误单词:";
for(int i=0;i<nj;i++){
cout<<c[i]<<' ';
cout<<endl<<"输入1:默写"<<endl<<"输入2:下一个";
int n=0;
cin>>n;
if(n==1){
cout<<"开始默写:";
string a;
cin>>a;
if(c[i]==a){
cout<<"RIGHT";
for(int j=i+1;j<nj;j++){
c[j]=c[j+1];
}
nj--;
}
}
}
}
else cout<<"还没有错题,快去默写吧!";
}
//修改个性签名
if(n==9){
system("cls");
cout<<"请输入新个性签名:";
string newgxqm;
cin>>newgxqm;
for(int i=0;i<jss;i++) {
if (nowgxqm == gx[i]) {
gx[i] = newgxqm;
nowgxqm = newgxqm;
cout << "个性签名修改成功!" << endl;
break;
}
}
}
}}
//清屏 void qp(){ system(“cls”); } //等待 void dd(){ Sleep(1000); } int main() { cout<<“-------welcome-------”; while(1){ cout<<endl<<“输入1:登录”<<endl<<“输入2:注册”<<endl<<“输入3:结束程序”<<endl; int n; cin>>n; if(n==1){ if(dl()==0)cout<<“账号或密码错误”; else{ system(“cls”); cout<<“登陆成功!”; Sleep(1000); system(“cls”); dlcg(); } } if(n==2){ zc(); } if(n==3){ for(int i=1;i<=3;i++){ system(“cls”); for(int i=1;i<=3;i++){ cout<<”.”; Sleep(100); } Sleep(1000); } system(“cls”); cout<<“-------goodbye-------”; return 0; } } return 0; } 总结:system(“cls”);清空页面 eep(1000);等待1秒*/