heehaw
驱动小牛
驱动小牛
  • 注册日期2003-03-20
  • 最后登录2005-04-25
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
阅读:863回复:5

这个世界很真实耶

楼主#
更多 发布于:2003-03-21 07:41
 
#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)
{
Boy目前拥有的除房子车子外条件=another;
}

bool Boy::赠送礼物(Girl girl,char *gift)
{

if(Boy将礼物送给girl)
return true;
else
return false;
}

long Boy::拼命赚钱()
{
Boy日夜操劳,两眼发黑,为的是月末能拿到那可怜的钞票;
return 一年挣下的钞票总数;
}

Girl::Girl()
{

}

Girl::~Girl()
{
}

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

void Girl::嫁给(Boy boy)
{
同意嫁给boy,与boy步入神圣的婚姻殿堂;
}


void main( )
{

Boy theBoy;
Girl theGirl;
int year;
long money;

theBoy.年龄=25;
theBoy.恋爱(theGirl);
year=1;
theGirl.感情=1;
theGirl.愿意等=true;
theGirl.生日=1001;
money=0;

  if( theBoy.有房==true&&theBoy.有车==true)
  {
   theBoy.其他具备条件(NOTHING);
   theGirl.嫁给(theBoy);
return;
  }
  while (theGirl.愿意等==true)
  {
 
   for( int day=1; day<=365; day++)
   {
    if( 节日转换(day) == 情人节)
{
     if( theBoy.赠送礼物(theGirl,玫瑰))
      theGirl.感情++;
     else
      theGirl.感情--;
}
    if( 日期转换(day) == theGirl.生日)
{
     if( theBoy.赠送礼物(theGirl,玫瑰))
      theGirl.感情++;
     else
      theGirl.感情--;
}

money+=theBoy.拼命赚钱();
   }
    if(money>1000000)
    {
     theBoy.有房=true;
theBoy.有车=true;
theGirl.愿意等=false;
break;
    }

theBoy.年龄++;
    theGirl.感情--;

if(theBoy.年龄>30||the.Girl.感情<0)
theGirl.愿意等=false;
}
if(theBoy.有房==true&&theBoy.有车==true)
theGirl.嫁给(theBoy);
else
{
Boy anotherBoy;
theGirl.恋爱(anotherBoy);
}
}
 :D :D
我热爱生命,但面对现实的社会经常感到无奈,所以只有嘿嘿傻笑 我迷恋科技,但飞速发展的世界使我眼花缭乱,所以必须埋头苦练
abc0099
论坛版主
论坛版主
  • 注册日期2002-09-28
  • 最后登录2007-10-31
  • 粉丝0
  • 关注0
  • 积分50分
  • 威望5点
  • 贡献值0点
  • 好评度5点
  • 原创分0分
  • 专家分0分
沙发#
发布于:2003-03-21 11:17
你写的? :o :D :o
[color=pink]彩虹是天空雨后的微笑[/color]
heehaw
驱动小牛
驱动小牛
  • 注册日期2003-03-20
  • 最后登录2005-04-25
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
板凳#
发布于:2003-03-21 11:19
不是不是,我可没有这么好的创意,呵呵 :D :D :D
转来得
我热爱生命,但面对现实的社会经常感到无奈,所以只有嘿嘿傻笑 我迷恋科技,但飞速发展的世界使我眼花缭乱,所以必须埋头苦练
hometown
驱动大牛
驱动大牛
  • 注册日期2002-10-24
  • 最后登录2004-05-21
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
地板#
发布于:2003-03-21 11:22
很好, 有创痍, 大致看了, 思路清晰!
How fair and how pleasant art thou, O love, for delights!This thy stature is like to a palm tree, and thy breasts to clusters of grapes.I said, I will go up to the palm tree, I will take hold of the boughs thereof: now also thy breasts shall be as clusters of the vine, and the smell of thy nose like apples;And the roof of thy mouth like the best wine for my beloved, that goeth down sweetly, causing the lips of those that are asleep to speak.
debug
驱动大牛
驱动大牛
  • 注册日期2002-06-06
  • 最后登录2012-10-15
  • 粉丝0
  • 关注0
  • 积分105分
  • 威望12点
  • 贡献值0点
  • 好评度9点
  • 原创分0分
  • 专家分0分
地下室#
发布于:2003-03-21 11:24
编译了一下,暂时不能通过
偶继续debug...... :(
偶爱c/c++,正如世人爱上帝一样。。。。 唐僧正在火焰山下分配工作:“悟空去借芭蕉扇,悟净去找水--八戒,你怎么还有空看偶的个人资料??
heehaw
驱动小牛
驱动小牛
  • 注册日期2003-03-20
  • 最后登录2005-04-25
  • 粉丝0
  • 关注0
  • 积分0分
  • 威望0点
  • 贡献值0点
  • 好评度0点
  • 原创分0分
  • 专家分0分
5楼#
发布于:2003-03-21 11:38
编译了一下,暂时不能通过
偶继续debug...... :(

不是吧,不愧为debug
 :o :o :o
我热爱生命,但面对现实的社会经常感到无奈,所以只有嘿嘿傻笑 我迷恋科技,但飞速发展的世界使我眼花缭乱,所以必须埋头苦练
游客

返回顶部