📄 level6.cpp
字号:
w=l6_word[q];
l6_word[q]=l6_word[q+1];
l6_word[q+1]=w;
}
}
}
for(int i=0;i<n6;i++)
{
cout<<l6_word[i].chinese<<endl;
cin>>word_c;
if(strcmp(word_c,l6_word[i].english)==0)
{
cout<<" 恭喜!您输入的单词正确!"<<endl; s6++; m++;
cout<<" 您已经背诵了"<<m<<"个单词,"<<"还有"<<n6-m<<"个没有背诵"<<endl;
z: cout<<" 继续背诵,y/n?"<<endl;
string d;
cin>>d;
if(d=="y")
{
cout<<" 加油哦~~"<<endl;
continue;
}
else if(d=="n")
{
s:
cout<<" 您还有"<<n6-m<<"个单词没有背诵,返回,y/n?"<<endl;
string e;
cin>>e;
system("cls");
if (e=="y")
{
level6();
}
else if(e=="n") continue;
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto s;
}
}
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto z;
}
}
else if(strcmp(word_c,l6_word[i].english)!=0)
{
cout<<" 很遗憾,您输入的单词错误。"<<endl; r6++; m++;
cout<<" 您已经背诵了"<<m<<"个单词,"<<"还有"<<n6-m<<"个没有背诵"<<endl;
cout<<" 继续背诵,y/n?"<<endl;
string d1;
cin>>d1;
if(d1=="y")
{
cout<<" 加油哦~~"<<endl;
continue;
}
else if(d1=="n")
{
t: cout<<" 您还有"<<n6-m<<"个单词没有背诵,返回,y/n?"<<endl;
string e1;
cin>>e1;
system("cls");
if (e1=="y")
{
level6();
}
else if(e1=="n") continue;
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto t;
}
}
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto z;
}
}
}
cout<<" 您已经测试完了所有的单词,您共背诵正确了"<<s6<<"个单词,"<<endl;
cout<<" 您共背诵错误了"<<r6<<"个单词."<<"谢谢您的使用。"<<endl;
cout<<" 我们真心希望通过我们的不懈努力能帮助您记忆单词。"<<endl;
cout<<" 请按回车键返回......"<<endl;
while(!kbhit());
getchar();
system("cls");
level6();
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void memory6_r(void)
{
int m=0; //统计已经背诵的单词个数
cout<<endl<<endl<<endl;
cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<" | ~心 莹 背 单 词~ |"<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl<<endl;
cout<<" 现在开始背诵!"<<endl;
cout<<" 下面系统将会输入单词的汉语意思,请您拼写~"<<endl;
char word_c[15];
ifstream word("level6_word.txt",ios::in);
if (!word)
{
cerr<<"open error"<<endl;
exit(1);
}
for(int j=0;j<n6;j++)
{
word>>l6_word[j].english;
word>>l6_word[j].chinese;
}
word.close();
for(int i=0;i<n6;i++)
{
r:
// 用随机函数
srand(time(0));//获得一个整数;
int fav=rand()%n6;//把刚才的整数赋值给fav
cout<<l6_word[fav].chinese<<endl;
cin>>word_c;
if(strcmp(word_c,l6_word[fav].english)==0)
{
cout<<" 恭喜!您输入的单词正确!"<<endl; s6++; m++;
cout<<" 您已经背诵了"<<m<<"个单词"<<endl;
s: cout<<" 继续背诵,y/n?"<<endl;;
string d;
cin>>d;
if(d=="y")
{
cout<<" 您还有"<<n6-m<<"个单词没有背诵,加油哦~"<<endl;
goto r;
}
if(d=="n")
{
cout<<" 您还有"<<n6-m<<"个单词没有背诵!"<<endl;
cout<<" 返回,y/n?"<<endl;
string e;
cin>>e;
system("cls");
if(e=="y") level6();
}
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto s;
}
}
else if(strcmp(word_c,l6_word[i].english)!=0)
{
cout<<" 很遗憾,您输入的单词错误。"<<endl; r6++; m++;
cout<<" 您已经背诵了"<<m<<"个单词"<<endl;
o:
cout<<" 继续背诵,y/n?"<<endl;
string d1;
cin>>d1;
if(d1=="y")
{
cout<<" 您还有"<<n6-m<<"个单词没有背诵,加油哦~"<<endl;
goto r;
}
else if(d1=="n")
{
cout<<" 您还有"<<n6-m<<"个单词没有背诵!"<<endl;
cout<<" 返回,y/n?"<<endl;
string e1;
cin>>e1;
if(e1=="y")
{
system("cls");
level6();
}
}
else
{
cout<<" 您输入的信息错误,请重新输入..."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
goto o;
}
}
}
cout<<" 您已经测试完了所有的单词,您共背诵正确了"<<s6<<"个单词,"<<endl;
cout<<" 您共背诵错误了"<<r6<<"个单词."<<"谢谢您的使用。"<<endl;
cout<<" 我们真心希望通过我们的不懈努力能帮助您记忆单词。"<<endl;
cout<<" 请按回车键返回......"<<endl;
while(!kbhit());
getchar();
system("cls");
level6();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -