⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eng_chi.cpp

📁 这是一个记忆单词的小系统 和电子词典的功能差不多 但是不用花钱买 对记忆单词特别有好处
💻 CPP
字号:
#include "1.h"
void eng_chi(void)
{
C:
	char old_name[10];
	cout<<endl<<endl<<endl;
   	cout<<"                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
   	cout<<"                    |          ~心 莹 英 汉 词 典~        |"<<endl;
    cout<<"                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl<<endl;
    ifstream name("name1.txt",ios::in);
	if (!name)
	{
	   	cerr<<"open error"<<endl;
        exit(1);
	}
   	name>>old_name;
    cout<<"                                  "<<old_name;
    cout<<"您好!"<<endl<<endl;
	cout<<"                          ~~欢迎您使用心莹英汉字典~~"<<endl<<endl;
	cout<<"                         心莹背单词真诚您对我们的支持!"<<endl<<endl<<endl<<endl;
	cout<<"                                 1.开始查询单词"<<endl<<endl;
	cout<<"                                 2.返回上一层"<<endl<<endl;
	cout<<"                                 3.   退出"<<endl;
	string b;
	cin>>b;
	system("cls");
	if (b=="1")  search_ec();
	else if (b=="2")  old_entry();
	else if (b=="3")  exit();
	else 
	{
		cout<<"                         您的输入有误,请重新输入......"<<endl;
		cout<<"                             请按回车键继续"<<endl;
		while(!kbhit());
		getchar();
		system("cls");
		goto C;
	}
	
}






///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////



void search_ec(void)
{

  //  system("cls");
	cout<<endl<<endl<<endl;
    cout<<"                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
	cout<<"                      |         ~心 莹 背 单 词~         |"<<endl;
   	cout<<"                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl;
	cout<<"                               ~欢迎您使用本系统~"<<endl<<endl;
F:
	cout<<"                            请输入您要查询的英语单词..."<<endl<<endl;
	cout<<"                                   ";
	char word_e[20];
	cin>>word_e;
	ifstream intotal_word("total_word.txt",ios::in);
	if(!intotal_word)
	{
		cerr<<"open error"<<endl;
		exit(1);
	}
	total_word tword[30];

	for(int i=0;i<30;i++)
	{
		intotal_word>>tword[i].english;
		intotal_word>>tword[i].chinese;
	}
	
	for(int j=0;j<29;j++)
	{
		if(strcmp(tword[j].english,word_e)==0)
		{
			cout<<"                     它的汉语意思是:"<<tword[j].chinese<<endl;
G:
			cout<<"                               继续查询,y/n?"<<endl;
			string f;
			cin>>f;
			if(f=="y")    goto F;
			else if(f=="n") welcome();
			else
			{	
				cout<<"                         您的输入有误,请重新输入......"<<endl;
	        	cout<<"                             请按回车键继续"<<endl;
		        while(!kbhit());
	        	getchar();
		        system("cls");
		        goto G;
			}
		}
	}
	if(strcmp(word_e,tword[29].english)!=0)
	{
		cout<<"                   对不起,您查询的单词不存在,请您重新输入."<<endl; 
	//	cout<<"按回车键继续...";
	//	while(!kbhit())
		goto F;
	}
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -