?? add.cpp
字號(hào):
#include "1.h"
extern int n4;
extern int n6;
extern int nm;
void add(void)
{
x:
cout<<endl<<endl<<endl;
cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<" | ~心 瑩 背 單 詞~ |"<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl<<endl;
cout<<" ~增~加~新~詞~"<<endl<<endl;
cout<<" 1.增加到大學(xué)四級(jí)詞匯"<<endl<<endl;
cout<<" 2.增加到大學(xué)六級(jí)詞匯"<<endl<<endl;
cout<<" 3.增加到專業(yè)英語(yǔ)詞匯"<<endl<<endl;
cout<<" 4. 返回上一層"<<endl<<endl;
cout<<" 5. 退出"<<endl;
string g;
cin>>g;
system("cls");
if (g=="1")
{
C:
cout<<endl<<endl<<endl;
cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<" | ~心 瑩 背 單 詞~ |"<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl<<endl;
cout<<" ~~歡迎您使用增加新詞功能~~"<<endl<<endl;
cout<<" 您將增加新詞在四級(jí)詞庫(kù)中, y/n?"<<endl<<endl;
cout<<" ";
string b;
cin>>b;
system("cls");
if(b=="y")
{
D:
cout<<endl<<endl<<endl;
cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<" | ~心 瑩 背 單 詞~ |"<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl<<endl;
cout<<" 心瑩背單詞感謝您的使用"<<endl<<endl;
cout<<" 請(qǐng)輸入您要增加的新單詞以及它的漢語(yǔ)意思:"<<endl<<endl;
cout<<" ";
string new4_e,new4_c;
cin>>new4_e>>new4_c;
ofstream outlevel4("level4_word.txt",ios::app);
if (!outlevel4)
{
cerr<<"open error"<<endl;
exit(1);
}
outlevel4<<new4_e<<" "<<new4_c<<" "; n4++;
E:
cout<<" 您已經(jīng)成功增加了一個(gè)新詞,是否繼續(xù)添加.y/n?"<<endl<<endl;
string c;
cin>>c;
system("cls");
if(c=="y") goto D;
else if(c=="n") welcome();
else
{
cout<<" 您輸入的信息錯(cuò)誤,請(qǐng)重新輸入......."<<endl;
cout<<" 請(qǐng)按回車鍵繼續(xù)..."<<endl;
while(!kbhit());
getchar();
goto E;
}
outlevel4.close();
ofstream outnum_word("num_word4.txt",ios::out);
if (!outnum_word)
{
cerr<<"open error"<<endl;
exit(1);
}
outnum_word<<n4;
outnum_word.close(); //統(tǒng)計(jì)單詞數(shù)
}
else if (b=="n")
{
cout<<" 您已經(jīng)取消了增加新詞的操作,謝謝!";
system("cls");
entry();
}
else
{
cout<<" 您的輸入有誤,請(qǐng)重新輸入......"<<endl;
cout<<" 請(qǐng)按回車鍵繼續(xù)..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto C;
}
}
else if (g=="2")
{
C1:
cout<<endl<<endl<<endl;
cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<" | ~心 瑩 背 單 詞~ |"<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl<<endl;
cout<<" ~~歡迎您使用增加新詞功能~~"<<endl<<endl;
cout<<" 您將增加新詞在六級(jí)詞庫(kù)中, y/n?"<<endl<<endl;
cout<<" ";
string b;
cin>>b;
system("cls");
if(b=="y")
{
D1:
cout<<endl<<endl<<endl;
cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<" | ~心 瑩 背 單 詞~ |"<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl<<endl;
cout<<" 心瑩背單詞感謝您的使用"<<endl<<endl;
cout<<" 請(qǐng)輸入您要增加的新單詞以及它的漢語(yǔ)意思:"<<endl<<endl;
cout<<" ";
string new6_e,new6_c;
cin>>new6_e>>new6_c;
ofstream outlevel6("level6_word.txt",ios::app);
if (!outlevel6)
{
cerr<<"open error"<<endl;
exit(1);
}
outlevel6<<new6_e<<" "<<new6_c<<" "; n6++;
outlevel6.close();
E1:
cout<<" 您已經(jīng)成功增加了一個(gè)新詞,是否繼續(xù)添加.y/n?"<<endl<<endl;
string c;
cin>>c;
system("cls");
if(c=="y") goto D1;
else if(c=="n") welcome();
else
{
cout<<" 您輸入的信息錯(cuò)誤,請(qǐng)重新輸入......."<<endl;
cout<<" 請(qǐng)按回車鍵繼續(xù)..."<<endl;
while(!kbhit());
getchar();
goto E1;
}
ofstream outnum_word("num_word6.txt",ios::out);
if (!outnum_word)
{
cerr<<"open error"<<endl;
exit(1);
}
outnum_word<<n6;
outnum_word.close(); //統(tǒng)計(jì)單詞數(shù)
}
else if (b=="n")
{
cout<<" 您已經(jīng)取消了增加新詞的操作,謝謝!";
system("cls");
entry();
}
else
{
cout<<" 您的輸入有誤,請(qǐng)重新輸入......"<<endl;
cout<<" 請(qǐng)按回車鍵繼續(xù)..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto C1;
}
}
else if (g=="3")
{
C2:
cout<<endl<<endl<<endl;
cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<" | ~心 瑩 背 單 詞~ |"<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl<<endl;
cout<<" ~~歡迎您使用增加新詞功能~~"<<endl<<endl;
cout<<" 您將增加新詞在專業(yè)英語(yǔ)詞庫(kù)中, y/n?"<<endl<<endl;
cout<<" ";
string b;
cin>>b;
system("cls");
if(b=="y")
{
D2:
cout<<endl<<endl<<endl;
cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<" | ~心 瑩 背 單 詞~ |"<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl<<endl;
cout<<" 心瑩背單詞感謝您的使用"<<endl<<endl;
cout<<" 請(qǐng)輸入您要增加的新單詞以及它的漢語(yǔ)意思:"<<endl<<endl;
cout<<" ";
string newm_e,newm_c;
cin>>newm_e>>newm_c;
ofstream outlevelm("levelm_word.txt",ios::app);
if (!outlevelm)
{
cerr<<"open error"<<endl;
exit(1);
}
outlevelm<<newm_e<<" "<<newm_c<<" "; nm++;
outlevelm.close();
E2:
cout<<" 您已經(jīng)成功增加了一個(gè)新詞,是否繼續(xù)添加.y/n?"<<endl<<endl;
string c;
cin>>c;
system("cls");
if(c=="y") goto D2;
else if(c=="n") welcome();
else
{
cout<<" 您輸入的信息錯(cuò)誤,請(qǐng)重新輸入......."<<endl;
cout<<" 請(qǐng)按回車鍵繼續(xù)..."<<endl;
while(!kbhit());
getchar();
goto E2;
}
ofstream outnum_word("num_wordm.txt",ios::out);
if (!outnum_word)
{
cerr<<"open error"<<endl;
exit(1);
}
outnum_word<<nm;
outnum_word.close(); //統(tǒng)計(jì)單詞數(shù)
}
else if (b=="n")
{
cout<<" 您已經(jīng)取消了增加新詞的操作,謝謝!";
system("cls");
entry();
}
else
{
cout<<" 您的輸入有誤,請(qǐng)重新輸入......"<<endl;
cout<<" 請(qǐng)按回車鍵繼續(xù)..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto C2;
}
}
else if (g=="4")
{
entry();
}
else if (g=="5") exit();
else
{
cout<<" 您輸入的信息錯(cuò)誤,請(qǐng)重新輸入......."<<endl;
cout<<" 請(qǐng)按回車鍵繼續(xù)..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto x;
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -