📄 welcome.cpp
字号:
#include "1.h"
void welcome(void)
{
C:
system("cls");
cout<<endl<<endl<<endl<<endl;
cout<<" ++++++++++++++++++++++++++++++++++++++++++++++++\n";
cout<<" + +"<<endl;
cout<<" + 欢 迎 您 使 用 心 莹 背 单 词 程 序 +"<<endl;
cout<<" + +"<<endl;
cout<<" ++++++++++++++++++++++++++++++++++++++++++++++++"<<endl;
cout<<endl<<endl<<endl;
cout<<" 1.系统登录"<<endl;
cout<<endl;
cout<<" 2.系统简介"<<endl;
cout<<endl;
cout<<" 3.系统帮助"<<endl;
cout<<endl;
cout<<" 4. 退出"<<endl;
string d; //根据用户输入的数字,给出对应的信息。
cin>>d;
system("cls");
E:
if (d=="1")
{
d: cout<<endl<<endl<<endl<<endl;
cout<<" ________________________________________"<<endl;
cout<<" | |"<<endl;
cout<<" | 欢 迎 您 登 录 心 莹 背 单 词 程 序 |"<<endl;
cout<<" | |"<<endl;
cout<<" ----------------------------------------"<<endl;
cout<<endl<<endl<<endl;
cout<<" 1.新用户登录"<<endl;
cout<<endl;
cout<<" 2.老用户登录"<<endl; //目前只能用一个用户
cout<<endl;
cout<<" 3.帮助信息"<<endl;
cout<<endl;
cout<<" 4.返回上一层"<<endl;
cout<<endl;
cout<<" 5. 退出"<<endl; //用户登录界面
string d1;
cin>>d1;
system("cls");
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (d1=="1")
{
O:
cout<<endl<<endl<<endl<<" ~W E L C O M E~"<<endl<<endl<<endl;
cout<<" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"<<endl<<endl<<endl<<endl;
cout<<" 心莹背单词欢迎您的到来,您是新用户,请输入您的用户名,以便保存您"<<endl;
cout<<" 的用户信息,来更好的帮助您背单词."<<endl;
ofstream name("name1.txt",ios::out);
if (! name)
{
cerr<<"open error"<<endl;
exit(1);
}
char guest_name[10];
cout<<endl<<endl<<endl<<endl<<endl<<" ";
cin>>guest_name;
name<<guest_name;
name.close();
cout<<" 是否设密码 y/n?"<<endl;
cout<<" ";
string a;
ofstream outnum("num_c.txt",ios::out); //把a的值记下来也就是用户是否设了密码
if(! outnum)
{
cerr<<"open error"<<endl;
exit(1);
}
cin>>a;
outnum<<a;
outnum.close();
system("cls");
if (a=="y") // 加密码(好好想想)
{
cout<<endl<<endl<<endl;
cout<<" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<" | ~心 莹 背 单 词~ |"<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl<<endl;
I:
cout<<" 请您输入密码:"<<endl;
cout<<" ";
string code;
cin>>code;
cout<<" 您输入的密码是"<<code<<endl;
cout<<" 确定,y/n?"<<endl;
string b;
cin>>b;
if(b=="y")
{
ofstream outcode("code_guest.txt",ios::out);
if (!outcode)
{
cerr<<"open error"<<endl;
exit(1);
}
outcode<<code;
outcode.close();
system("cls");
entry();
}
else if(b=="n")
{
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
cout<<" 请您重新输入密码..."<<endl;
goto I;
}
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto O;
}
}
else if (a=="n") entry(); //调用entry函数
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto O;
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
else if (d1=="2")
{
old_entry(); //调用old_entry函数
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
else if (d1=="3")
{
y:
cout<<endl<<endl<<endl;
cout<<" ^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<" | 系 统 登 录 帮 助 |"<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~~"<<endl<<endl<<endl<<endl;
cout<<" 欢迎您使用心莹帮助信息!"<<endl;
cout<<" 开始登录,如果您是新用户,请选择新用户登录,然后输入您的用户"<<endl;
cout<<" 名(可选加密)。如果您是老用户,您就可以直接选择老用户直接登录,"<<endl;
cout<<" 进入背单词中......"<<endl<<endl<<endl<<endl;
cout<<" 如果您仍然有问题,请与管理员联系。"<<endl<<endl<<endl;
cout<<" 电子信箱:poydel@163.com"<<endl<<endl;
cout<<" 1. 返回重新登录"<<endl<<endl;
cout<<" 2. 退出"<<endl;
string d11;
cin>>d11;
system("cls");
if (d11=="1") goto E;
else if (d11=="2") exit();
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto y;
}
}
else if(d1=="4") goto C;
else if(d1=="5") exit();
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto d;
}//不是上述数字的问题
///////////////////////////////////////////////////////////////////////////////////////////////////
}
else if(d=="2")
{
z:
cout<<endl<<endl<<endl<<endl;
cout<<" ************"<<endl;
cout<<" * 系统简介 *"<<endl;
cout<<" ************"<<endl;
cout<<endl<<endl<<endl<<endl<<endl;
cout<<" 欢迎您的使用,本系统是一个给学习英语的学生而设计的,提"<<endl;
cout<<" 供单词的背诵和单词查询等功能。"<<endl;
cout<<endl<<endl<<endl<<endl<<endl<<endl<<endl;
cout<<" 1.继续登录"<<endl;
cout<<" 2. 退出"<<endl;
string d1;
cin>>d1;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if(d1=="1")
{
system("cls");
goto C;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
else if(d1=="2")
{
exit();
}
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto z;
}//输入不是1,2和数怎么处理
}
///////////////////////////////////////////////////////////////////////////////////////////////////
else if(d=="3")
{
D:
cout<<endl<<endl<<endl<<endl;
cout<<" ************"<<endl;
cout<<" * 系统帮助 *"<<endl;
cout<<" ************"<<endl;
cout<<endl<<endl<<endl<<endl;
cout<<" 心莹背单词是一个简单而又实用的背单词的小工具,适合种类学习英语的人群."<<endl<<endl;
cout<<" 使用方法如下:"<<endl<<endl;
cout<<" 1.新手快速入门"<<endl<<endl;
cout<<" 2.老用户帮助"<<endl<<endl;
cout<<" 3.返回继续登录"<<endl<<endl;
cout<<" 4.退出"<<endl;
string d2;
cin>>d2;
system("cls");
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (d2=="1")
{
b:
cout<<endl<<endl<<endl;
cout<<" ^^^^^^^^^^^^^^^^^^^"<<endl;
cout<<" | 新 手 快 速 入 门 |"<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~~"<<endl;
cout<<endl;
cout<<" 欢迎您使用本帮助信息,也感谢您对心莹的支持.我们定会尽我们的最大努力为您服务."<<endl;
cout<<" -------石海杰"<<endl<<endl<<endl;
cout<<" 进入登录界面,您将会看到提示信息.新用户请按1,系统会提示您输入您的用户名,以便下"<<endl;
cout<<"次登录时使用,来统计您的个人信息.统计您每次背单词的各项信息,提高您记单词的效率.您"<<endl;
cout<<"可以把您不会的单词储存起来,也可以把您已经掌握的单词删除."<<endl;
cout<<endl<<endl<<" 更多功能我在此就不一一介绍了,每一步都会有系统提示."<<endl;
cout<<endl<<" 希望你对我们提出宝贵的意见和建议.谢谢您的使用~!"<<endl<<endl;
cout<<" 1.继续登录; "<<endl;
cout<<" 2.返回上一层. "<<endl;
cout<<" 3.退出."<<endl;
string d21;
cin>>d21;
system("cls");
if (d21=="1") goto C; //返回登录界面
else if (d21=="2") goto D; //返回帮助界面
else if (d21=="3") exit();
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto b;
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
else if (d2=="2")
{
Y:
cout<<endl<<endl<<endl;
cout<<" ^^^^^^^^^^^^^^^^^^"<<endl;
cout<<" | 老 用 户 帮 助 |"<<endl;
cout<<" ~~~~~~~~~~~~~~~~~~"<<endl;
cout<<endl;
cout<<" 欢迎您使用本帮助信息,也感谢您对心莹的支持.我们定会尽我们的最大努力为您服务."<<endl;
cout<<" -------石海杰"<<endl<<endl<<endl;
cout<<" 如果您已经设置了密码,您在登录后系统会提示您输入您的密码,如果您"<<endl;
cout<<" 忘记了密码,请与管理员联系."<<endl;
cout<<" 心莹真诚为您服务"<<endl;//通过程序的具体情况再定
cout<<" 1.继续登录; "<<endl;
cout<<" 2.返回上一层. "<<endl;
cout<<" 3.退出."<<endl;
string d22;
cin>>d22;
system("cls");
if (d22=="1") goto C;
else if (d22=="2") goto D;
else if (d22=="3") exit();
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto Y;
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
else if(d2=="3") goto C;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
else if(d2=="4") exit();
else
{
cout<<" 您输入的信息错误,请重新输入......."<<endl;
system("cls");
goto D;
}
}
else if(d=="4") exit();
else
{
cout<<"您输入的信息错误,麻烦您重新输入~!"<<endl;
cout<<" 请按回车键继续..."<<endl;
while(!kbhit());
getchar();
system("cls");
goto C;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -