|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#include<iostream>
#include<windows.h>
class Nvpu
{
public:
std::string color;
unsigned int height;
std::string nose;
std::string mouth;
unsigned int weight;
unsigned int mood;
void setheight(unsigned int tall);
void setnose(std::string big1);
void setmouth(std::string small1);
void setcolor(std::string col);
void setweight(unsigned int wt);
int dancing(void);
void setmood(unsigned int mount);
void setwarning(void);
};
void Nvpu::setheight(unsigned int tall)
{
height = tall;
}
void Nvpu::setnose(std::string big1)
{
nose = big1;
}
void Nvpu::setmouth(std::string small1)
{
mouth = small1;
}
void Nvpu::setcolor(std::string col)
{
color = col;
}
void Nvpu::setweight(unsigned int wt)
{
weight = wt;
}
void Nvpu::setmood(unsigned int mount)
{
mood = 100;
}
int Nvpu::dancing(void)
{
std::cout<<"我正在做家务!小哥哥来帮帮我嘛!。。。\n";
mood--;
std::cout<<"我的心情正在减少,小哥哥要注意哦!"<<"当前剩余心情值:"<<mood<<'\n';
return mood;
}
void Nvpu::setwarning(void)
{
std::cout<<"女仆要生气了,小哥哥注意!\n";
}
int main()
{
char x=0;
Nvpu mynvpu;
int i=0;
mynvpu.setheight(175);
mynvpu.setmouth("samll");
mynvpu.setnose("samll");
mynvpu.setcolor("white");
mynvpu.setweight(85);
mynvpu.mood = 100;
while(mynvpu.dancing())
{
if(mynvpu.mood<10)
{
mynvpu.setwarning();
std::cout<<"请问是否选择陪女仆玩一会,以提升她的心情?(Y/N)\n";
std::cin>>x;
if(x == 'Y' || x == 'y')
{
std::cout << "\n正在陪女仆玩耍。。。。。 ";
for (int i = 0; i <= 100; i++) // 打印百分比
{
std::cout.width(3);
std::cout << i << "%";
Sleep(5);
std::cout << "\b\b\b\b";
}
mynvpu.setmood(mynvpu.mood);
std::cout<<"我现在心情美美哒!mua~~~\n";
}
}
}
return 0;
} |
|