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

📄 old_entry.cpp

📁 这是一个记忆单词的小系统 和电子词典的功能差不多 但是不用花钱买 对记忆单词特别有好处
💻 CPP
字号:
#include "1.h"

void old_entry(void)
{
w:
	char old_name[10];
	cout<<endl<<"                              ~W  E  L  C  O  M  E~"<<endl<<endl<<endl;
	cout<<"                    $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"<<endl<<endl<<endl<<endl;
	cout<<"                             心莹背单词感谢您的支持"<<endl<<endl;
	ifstream name("name1.txt",ios::in);
	if (!name)
	{
		cerr<<"open error"<<endl;
        exit(1);
	}
	name>>old_name;
	name.close();
	cout<<"                                  "<<old_name<<" ";
	cout<<"您好!"<<endl<<endl<<endl;
	ifstream innum("num_c.txt",ios::in);
	if(!innum)
	{
		cerr<<"open error"<<endl;
		exit(1);
	}
	string a;
	innum>>a;
	innum.close();
	if (a=="y")
	{
		cout<<"                        您已经设置了密码,请您输入密码进入."<<endl<<endl;
		cout<<"                                  ";
		string code;
		string code_zq;
		ifstream incode("code_guest.txt",ios::in);
	    if (!name)
		{
	    	cerr<<"open error"<<endl;
            exit(1);
		}
	    incode>>code_zq;
		incode.close();
		for(int i=0;i<3;i++)
		{
			cin>>code;
		    if(code==code_zq)
			{
			    cout<<"                                 您输入的密码正确."<<endl;break;
			}
			else if(code!=code_zq)
			{
				cout<<"                                 您输入的密码错误."<<endl;
				cout<<"                               很遗憾,您还有"<<2-i<<"次机会"<<endl;
				if(i==2)   
				{
					cout<<"                               您输入错误次数过多,谢谢."<<endl;
					system("cls");
					welcome();
				}
				cout<<"                                  请您重新输入..."<<endl;
				
			}
		}
   
	}
	cout<<"                                   我们开始吧~"<<endl;
	cout<<"                                    1.背单词"<<endl;
	cout<<"                                    2.增加新词"<<endl;
	cout<<"                                    3.英汉词典"<<endl;
	cout<<"                                    4.汉英词典"<<endl;
	cout<<"                                    5. 退出"<<endl;
	string d;
	cin>>d;
	system("cls");
	if (d=="1")          recite();                  //调用recite函数           
	else if (d=="2")     add();                   
	else if (d=="3")     eng_chi();              
    else if (d=="4")     chi_eng();
	else if (d=="5")     exit();
	else
	{
		cout<<"                         您输入的信息错误,请重新输入......."<<endl;
		cout<<"                                请按回车键继续..."<<endl;
	    while(!kbhit());
		getchar();
		system("cls");
		goto w;
	}	// 存在不是上述数字的问题~@@

 	
}

⌨️ 快捷键说明

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