#include <iostream>
using namespace std;
#include <string>
struct xingyunzhe
{
string X_name;
string X_yuyan;
};
void shuru(xingyunzhe* abc)
{
string name;
cout << "输入你想祝福的人的名字:" << endl;
cin >> name;
abc->X_name = name;
string zhufu;
cout << "输入你的祝福语:" << endl;
cin >> zhufu;
abc->X_yuyan = zhufu;
cout << "添加成功" << endl;
}
void shuchu(xingyunzhe* abc)
{
cout << abc->X_name << endl;
cout << abc->X_yuyan << endl;
system("pause");
system("cls");
}
void Menu()
{
cout << "**************************************" << endl;
cout << "***** 这是一份礼物 *****" << endl;
cout << "**************************************" << endl;
cout << "***** 先输入\"开始\",编辑礼物 *****" << endl;
cout << "***** 再输入\"礼物\",送上祝福 *****" << endl;
cout << "***** 可输入\"礼物\",默认祝福 *****" << endl;
cout << "**************************************" << endl;
}
int main()
{
string Ab;
int n = 0;
xingyunzhe abc;
while (true)
{
Menu();
cout << "请选择:";
cin >> Ab;
if (Ab == "开始")
{
shuru(&abc);
n = 1;
system("pause");
system("cls");
}
else if (Ab == "礼物")
{
while (n == 1)
{
shuchu(&abc);
return 0;
}
cout<<" **** **** 祝"<<endl;
cout<<" ****** ****** 你"<<endl;
cout<<" **************** 天"<<endl;
cout<<" ************** 天"<<endl;
cout<<" ************ 开"<<endl;
cout<<" ********** 心"<<endl;
cout<<" ******** !"<<endl;
cout<<" ****** "<<endl;
cout<<" **** "<<endl;
cout<<" ** 还未结束。"<<endl;
system("pause");
system("cls");
}
else
{
cout << "错误" << endl;
system("pause");
system("cls");
}
}
system("pause");
}
只是想与各位大佬交流一下!希望大家可以多多提出问题,希望还要有什么功能,也可以写下来。