自己写的一个叫作“礼物”的C++代码,请赐教!!!

#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");
    }

只是想与各位大佬交流一下!希望大家可以多多提出问题,希望还要有什么功能,也可以写下来。

  • 4
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

在下_诸葛

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值