C++代码之爱情篇爱情经典语录

shiwenhu 坐标: 47632 目录:无字图片黑白霸气

/*今在VC论坛上看到一段好代码叫C语言代码人生之爱情篇,各大虾正在热烈讨论,
现在哦把它简单地标准C++代码,作为抛砖引玉,供各位大虾继续发挥,写大人
生篇,事业篇什么的应该不难,最好写成了一段完整标准的C++语言语法教材*/
#include
#include
#include 一些必要头文件

#define NOTHING 不需任何东西

class Boy
{
public:
bool 有房;
bool 有车;
int 年龄;
public:
Boy();
~Boy();
void 恋爱(Girl girl);
void 具备条件(char *another);
bool 赠送礼物(Girl girl,char *gift)
long 拼命赚钱();
};

class Girl
{
public:
int 感情;
bool 愿意等;
int 生日;
public:
Girl();
~Girl();
void 恋爱(Boy boy);
void 嫁给(Boy boy);
};

Boy::Boy()
{
int i;
i=rand();
if(i=100)
{
有房=true;
}
else
{
有房=false;
}
i=rand();
if(i=200)
{
有车=true;
}
else
{
有车=false;
}
}

Boy::~Boy()
{

}

void Boy::恋爱(Girl girl)
{
与girl进入相恋阶段;
}

void Boy::其他具备条件(char *another)

🆕 New