?? level4.cpp
字號:
w=l4_word[q];
l4_word[q]=l4_word[q+1];
l4_word[q+1]=w;
}
}
}
for(int i=1;i<n4+1;i++)
{
cout<<" "<<l4_word[i].chinese<<endl;
cin>>word_c;
if(strcmp(word_c,l4_word[i].english)==0)
{
cout<<" 恭喜!您輸入的單詞正確!"<<endl; s4++; m++;
cout<<" 您已經背誦了"<<m<<"個單詞,"<<"還有"<<n4-m<<"個沒有背誦"<<endl;
z: cout<<" 繼續背誦,y/n?"<<endl;
string d;
cin>>d;
if(d=="y")
{
cout<<" 加油哦~~"<<endl;
continue;
}
else if(d=="n")
{
s:
cout<<" 您還有"<<n4-m<<"個單詞沒有背誦,返回,y/n?"<<endl;
string e;
cin>>e;
if (e=="y")
{
level4();
}
else if(e=="n")
{
continue;
}
else
{
cout<<" 您輸入的信息錯誤,請重新輸入......."<<endl;
cout<<" 請按回車鍵繼續..."<<endl;
while(!kbhit());
getchar();
goto s;
}
}
else
{
cout<<" 您輸入的信息錯誤,請重新輸入......."<<endl;
cout<<" 請按回車鍵繼續..."<<endl;
while(!kbhit());
getchar();
goto z;
}
}
if(strcmp(word_c,l4_word[i].english)!=0)
{
cout<<" 很遺憾,您輸入的單詞錯誤。"<<endl; r4++; m++;
cout<<" 您已經背誦了"<<m<<"個單詞,"<<"還有"<<n4-m<<"個沒有背誦"<<endl;
cout<<" 繼續背誦,y/n?"<<endl;
string d1;
cin>>d1;
if(d1=="y")
{
cout<<" 加油哦~~"<<endl;
}
else if(d1=="n")
{
t: cout<<" 您還有"<<n4-m<<"個單詞沒有背誦,返回,y/n?"<<endl;
string e1;
cin>>e1;
if (e1=="y")
{
system("cls");
level4();
}
else if(e1=="n")
{
continue;
}
else
{
cout<<" 您輸入的信息錯誤,請重新輸入......."<<endl;
cout<<" 請按回車鍵繼續..."<<endl;
while(!kbhit());
getchar();
goto t;
}
}
else
{
cout<<" 您輸入的信息錯誤,請重新輸入......."<<endl;
cout<<" 請按回車鍵繼續..."<<endl;
while(!kbhit());
getchar();
goto z;
}
}
}
n:
cout<<" 您已經測試完了所有的單詞,您共背誦正確了"<<s4<<"個單詞,"<<endl;
cout<<" 您共背誦錯誤了"<<r4<<"個單詞."<<"謝謝您的使用。"<<endl;
cout<<" 我們真心希望通過我們的不懈努力能幫助您記憶單詞。"<<endl;
cout<<" 1. 返回"<<endl;
cout<<" 2. 退出"<<endl;
string f;
cin>>f;
system("cls");
if(f=="1")
{
level4();
}
else if(f=="2") exit();
else
{
cout<<" 您輸入的信息錯誤,請重新輸入......."<<endl;
cout<<" 請按回車鍵繼續..."<<endl;
while(!kbhit());
getchar();
goto n;
}
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void memory4_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("level4_word.txt",ios::in);
if (!word)
{
cerr<<"open error"<<endl;
exit(1);
}
for(int j=0;j<n4;j++)
{
word>>l4_word[j].english;
word>>l4_word[j].chinese;
}
word.close();
for(int i=0;i<n4;i++)
{
r:
// 用隨機函數
srand(time(0));//獲得一個整數;
int fav=rand()%n4;//把剛才的整數賦值給fav
cout<<l4_word[fav].chinese<<endl;
cin>>word_c;
if(strcmp(word_c,l4_word[fav].english)==0)
{
cout<<" 恭喜!您輸入的單詞正確!"<<endl; s4++; m++;
cout<<" 您已經背誦了"<<m<<"個單詞"<<endl;
s: cout<<" 繼續背誦,y/n?"<<endl;;
string d;
cin>>d;
if(d=="y")
{
cout<<" 您還有"<<n4-m<<"個單詞沒有背誦,加油哦~"<<endl;
goto r;
}
if(d=="n")
{
cout<<" 您還有"<<n4-m<<"個單詞沒有背誦!"<<endl;
cout<<" 返回,y/n?"<<endl;
string e;
cin>>e;
system("cls");
if(e=="y") level4();
}
else
{
cout<<" 您輸入的信息錯誤,請重新輸入......."<<endl;
cout<<" 請按回車鍵繼續..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto s;
}
}
else if(strcmp(word_c,l4_word[i].english)!=0)
{
cout<<" 很遺憾,您輸入的單詞錯誤。"<<endl; r4++; m++;
cout<<" 您已經背誦了"<<m<<"個單詞"<<endl;
o:
cout<<" 繼續背誦,y/n?"<<endl;
string d1;
cin>>d1;
if(d1=="y")
{
cout<<" 您還有"<<n4-m<<"個單詞沒有背誦,加油哦~"<<endl;
goto r;
}
else if(d1=="n")
{
cout<<" 您還有"<<n4-m<<"個單詞沒有背誦!"<<endl;
cout<<" 返回,y/n?"<<endl;
string e1;
cin>>e1;
if(e1=="y")
{
system("cls");
level4();
}
}
else
{
cout<<" 您輸入的信息錯誤,請重新輸入..."<<endl;
cout<<" 請按回車鍵繼續..."<<endl;
while(!kbhit());
getchar();
goto o;
}
}
}
cout<<" 您已經測試完了所有的單詞,您共背誦正確了"<<s4<<"個單詞,"<<endl;
cout<<" 您共背誦錯誤了"<<r4<<"個單詞."<<"謝謝您的使用。"<<endl;
cout<<" 我們真心希望通過我們的不懈努力能幫助您記憶單詞。"<<endl;
cout<<" 請按回車鍵返回......"<<endl;
while(!kbhit());
getchar();
system("cls");
level4();
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -