|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
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";
}
} |
|