result love(boy, girl)
{
    if( boy.有房() and boy.有车() )
    {
        boy.set(nothing);
        return girl.嫁给(boy);
    }
    if( girl.愿意等() )
    {
    while(!(boy.赚钱 > 100,000 and girl.感情 > 8 ) )
    {
        for( day=1; day <=365; day++)
        {
            if( day == 情人节 )
            if( boy.givegirl(玫瑰) )
                girl.感情++;
            else
                girl.感情--;  
            if( day == girl.生日 )
            if( boy.givegirl(玫瑰) )
            {
                girl.感情++;
            else
                girl.感情--;
                boy.拼命赚钱();
            }
        }
        if( boy.有房() and boy.有车() )
        {
            boy.set(nothing);
            return girl.嫁给(boy);
        }
        年龄++;
        girl.感情--;
    }
    return girl.goto( another_boy);
}  

解决方案 »

  1.   

    少考虑到一个必要条件:girl.m_Age++
    if (!girl.isPretty(now))
    {
        girl.二话不说嫁(boy)
    }
    哈哈,自我安慰一下。
      

  2.   

    更正完善一下,绝对通过编译!
    BOOL 符合最终要求(boy)
    {
        if(帅哥.FACE-boy.FACE)>0.00000001f)
             return FALSE;
        CRect boyrc;
        boy.GetClientRect(&boyrc)
        if(178cm-boyrc.Height())>0.00000001f)
             return FALSE;
        if(boyrc.Width()-80cm>0.00000001f || 40cm-boyrc.Width()>0.00000001f)
             return FALSE;
        if(!boy.有房() || 房.belong!=boy || 房.size< CSize(100,100))
             return FALSE;
        if(!boy.有车()|| 车.GetWheelCount()<4)
             return FALSE;
        ......
           
        return TRUE;
        
    }
     
    result love(boy, girl)
    {
        if(符合最终要求(boy))
        {
            boy.set(nothing);
            return girl.嫁给(boy);
        }
        if( girl.愿意等() )
        {
            int year=0;
            while(!(boy.赚钱 > 100,000 && girl.感情 > 8 && girl.愿意等()))
            {
                for( int day=0; day <=365; day++)
                {
                    bool tempwinner=FALSE
                    switch (day)
                    {
                         case 情人节: if( boy.givegirl(玫瑰+AllRequest(girl)))
                                            tempwinner=TRUE;  break;
                         case girl.生日: if( boy.givegirl(玫瑰+AllRequest(girl))) 
                                            tempwinner=TRUE;  break;
                         case 妇女节 : if( boy.givegirl(玫瑰+AllRequest(girl))) 
                                            tempwinner=TRUE;  break; 
                         //.........
                         default:     if( boy.givegirl(AllRequest(girl))) 
                                            tempwinner=TRUE;  break; 
                    }
                    if (tempwinner)
                        girl.感情++;
                    else
                        girl.感情--;                boy.拼命赚钱();
                }
                year++;
            }
            if( 符合最终要求(boy))        
            {
                boy.set(nothing);
                return girl.嫁给(boy);
            }
            年龄++;
            if (!girl.isPretty(now))
            {
                return girl.嫁给(boy);
            }
            girl.感情--;
        }
        return girl.goto( another_boy);
    }  
      

  3.   

    完整的 CGirl 类 :)   //composed by dazedaseclass CGirl: public CHuman
    {
    // Construction
    public:
        CGirl(CHuman * pParent);    // standard constructor
        ~CGirl(CHuman * pMurderer);
    // Human Data
        //{{AFX_DATA(CGirl)
        enum { IDD = IDD_GIRLNAME};
        CHair       m_hair;
        CEyes       m_eyes;
        CNose       m_nose;
        CMouth       m_mouth;
        ......
        //}}AFX_DATA
        // ClassWizard generated virtual function overrides
        //{{AFX_VIRTUAL(CGirl)
        protected:
        virtual void DoBoyExchange(CBoyExchange* pDX);    // BoyChange support
        //}}AFX_VIRTUAL// Attributes
    public:
        CBitmap m_face;
        int m_Height;
        int m_Width;
        int 
        ......
    protected:
        int m_Age;
        long m_Weight;
        long m_BoyFriendCount;    ......// Implementation
    public:
        int GetAge(){ if( m_Age>25)  m_Age-=5; return m_Age;}
        int GetWeight(){ if( m_Weight>100) return 100; else return m_Weight;} 
        int GetBoyFriendCount(){ if(m_BoyFriendCount>1)  return 0; else return m_BoyFriendCount;)}    bool CheckAccessed (CBoy* boy);
        bool WillWaiting (int year=0);
        HResult Marrage (CBoy* boy);
        ......
    protected:
        // Generated message map functions
        //{{AFX_MSG(CGirl)
        virtual BOOL OnInitLove();
        afx_msg void OnBoyCommand(UINT nID, LPARAM lParam);
        afx_msg void OnPaint();
        afx_msg void OnSetfocusFace();
        afx_msg void OnSetfocusCloth();
        afx_msg void OnSetfocusShoe();
        afx_msg void OnSetfocusBoyFriend();
        ......
        afx_msg void OnKillfocusFace();
        afx_msg void OnKillfocusCloth();
        afx_msg void OnKillfocusShoe();
        afx_msg void OnKillfocusBoyFriend();
        ......    afx_msg void OnSize(UINT nType, int cx, int cy);
        afx_msg void OnWeight(UINT nType, int cx, int cy);
        ......
        afx_msg HBRUSH OnGivenColor(CBoy * BoyFriend);
        afx_msg BOOL OnEraseOldBoyFriend(CBoy * pOldBoyFriend);
        ......
        ......
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
    };
      

  4.   

    if( boy.givegirl(玫瑰) )
                {
                    girl.感情++;
                else
                    girl.感情--;
                    boy.拼命赚钱();
                }
    少了{