鱼C论坛

 找回密码
 立即注册
查看: 1056|回复: 0

[技术交流] c++完成女朋友(简易版)哪位大神有些新想法回复我

[复制链接]
发表于 2022-3-11 17:09:42 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
#include<iostream>
#define food 100
using namespace std;

class girlfriend
{
public:
        string name;
        string xb;
        double height=0;
        int eat_food=0;
        string clothes;
        void seteat_food(int fod);
        int setruin(void);
        void wring(void);
        void gohome(void);
        int ggirlfriend(void);
};

void girlfriend::seteat_food(int fod)
{
        eat_food+=fod ;
        cout << "好胀呀,吃饱了" << endl;
}

int girlfriend::setruin(void)
{
        cout << "我的名字叫" << name << "我的性别是" << xb << "我的身高是" << height << "cm"<<"我穿着"<<clothes<<endl;
        cout << "我正在跑步\n";
        eat_food = eat_food - 10;
        cout << "目前还有" << eat_food << "%的食物\n";
        return eat_food;
}

void girlfriend::wring(void)
{
        cout << "好饿呀!可以给人家吃饭吗?[y\N] 人家还有"<<eat_food<<"%的食物" << endl;
}

void girlfriend::gohome(void)
{
        cout << "哈尼,你想让人家做什么???\n";
        cout << "1.扫地     2.洗碗     3.做饭     4.睡觉     5.gun\n";
}

int girlfriend::ggirlfriend(void)
{
        cout << "好的我马上去做\n";
        eat_food = eat_food - 10;
        cout << "我弄好了,你快来" << endl;
        cout << "目前还有" << eat_food << "%的食物\n";
        return eat_food;
}

int main()
{
        char i;
        int c;
        girlfriend mygirlfriend;
        mygirlfriend.name = "小红";
        mygirlfriend.xb = "女";
        mygirlfriend.height = 172;
        mygirlfriend.eat_food = food;
        mygirlfriend.clothes="黑丝";
        while (mygirlfriend.eat_food)
        {

                if (mygirlfriend.eat_food == 10)
                {
                        mygirlfriend.wring();
                        cin >> i;
                        if ('y' == i || 'Y' == i)
                        {
                                mygirlfriend.seteat_food(food);
                        }
                        else
                        {
                                mygirlfriend.setruin();
                        }
                }
                if (mygirlfriend.eat_food > 10)
                {
                        mygirlfriend.gohome();
                        cin >> c;
                        if (c == 1 || c == 2 || c == 3 || c == 4)
                        {
                                mygirlfriend.ggirlfriend();
                        }
                        else
                        {
                                mygirlfriend.setruin();
                        }
                }
        }
        if (mygirlfriend.eat_food == 0)
                {
                        cout << "你个渣男,看来你另有新欢,我~~嗝屁了\n";
                }
}
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-5-22 16:23

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表