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

📄 chi_eng.cpp

📁 这是一个记忆单词的小系统 和电子词典的功能差不多 但是不用花钱买 对记忆单词特别有好处
💻 CPP
字号:
#include "1.h"
void chi_eng(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<<endl;
	cout<<"                                 4.   退出"<<endl;
	string b;
	cin>>b;
	system("cls");
	if (b=="1")  search_ce();
	else if (b=="2")  
	{
D:
    	cout<<endl<<endl<<endl;
        cout<<"                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
    	cout<<"                      |         ~心 莹 背 单 词~         |"<<endl;
     	cout<<"                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl<<endl;
    	cout<<"                               ~欢迎您使用本系统~"<<endl;
		cout<<"                 您现在使用的是心莹汉英字典的帮助信息.你可以输入您要查询"<<endl;
		cout<<"             的汉语意思,各级组织府给您提供它的英语单词."<<endl<<endl<<endl;
		cout<<"                          如果您仍然有问题,请与管理员联系。"<<endl<<endl<<endl;
	    cout<<"                               电子信箱:poydel@163.com"<<endl<<endl;
		cout<<"                                1. 返回查词"<<endl<<endl;
		cout<<"                                2. 退出"<<endl;
        string c;
		cin>>c;
		if(c=="1")  goto C;
		else if(c=="2")  exit();
		else
		{
            cout<<"                         您的输入有误,请重新输入......"<<endl;
	    	cout<<"                             请按回车键继续"<<endl;
	    	while(!kbhit());
	    	getchar();
	    	system("cls");
			goto D;
		}
	}
	else if (b=="3")  old_entry();
	else if (b=="4")  exit();
	else 
	{
		cout<<"                         您的输入有误,请重新输入......"<<endl;
		cout<<"                             请按回车键继续"<<endl;
		while(!kbhit());
		getchar();
		system("cls");
		goto C;
	}
	
}






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


void search_ce(void)
{ 
//	bool word;
	cout<<endl<<endl<<endl;
    cout<<"                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
	cout<<"                      |         ~心 莹 背 单 词~         |"<<endl;
   	cout<<"                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl;
	cout<<"                               ~欢迎您使用本系统~"<<endl<<endl;
F:
	cout<<"                            请输入您要查询的汉语意思..."<<endl<<endl;
	cout<<"                                   ";
	char word_c[20];
	cin>>word_c;
	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;
	    //cout<<tword[i].english<<" ";
		//cout<<tword[i].chinese<<endl;
	}
	intotal_word.close();
	
	for(int j=0;j<30;j++)
	{
		if(strcmp(word_c,tword[j].chinese)==0)
		{
			cout<<"                    英语单词是:"<<tword[j].english<<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_c,tword[j].chinese)!=0)
	{
		cout<<"                   对不起,您查询的单词不存在,请您重新输入."<<endl;
		goto F;
	}
	

}


⌨️ 快捷键说明

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