日韩精品福利免费观看高清,综合亚洲国产2020,99热只有精品这里,国产精品久久久久久久福利

    1. <address id="kobe1"></address>
      
      
      <td id="kobe1"><tbody id="kobe1"><listing id="kobe1"></listing></tbody></td>

        C++代碼之愛(ài)情篇愛(ài)情經(jīng)典語(yǔ)錄

        發(fā)布時(shí)間:2017-12-09  編輯:admin 手機(jī)版
        /*今在VC論壇上看到一段好代碼叫C語(yǔ)言代碼人生之愛(ài)情篇,各大蝦正在熱烈討論,
        現(xiàn)在哦把它簡(jiǎn)單地標(biāo)準(zhǔn)C++代碼,作為拋磚引玉,供各位大蝦繼續(xù)發(fā)揮,寫(xiě)成人
        生篇,事業(yè)篇什么的應(yīng)該不難,最好寫(xiě)成了一段完整標(biāo)準(zhǔn)的C++語(yǔ)言語(yǔ)法教材*/
        #include
        #include
        #include 一些必要頭文件
        #define NOTHING 不需任何東西
        class Boy
        {
        public:
        bool 有房;
        bool 有車;
        int 年齡;
        public:
        Boy();
        ~Boy();
        void 戀愛(ài)(Girl girl);
        void 具備條件(char *another);
        bool 贈(zèng)送禮物(Girl girl,char *gift)
        long 拼命賺錢();
        };
        class Girl
        {
        public:
        int 感情;
        bool 愿意等;
        int 生日;
        public:
        Girl();
        ~Girl();
        void 戀愛(ài)(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::戀愛(ài)(Girl girl)
        {
        與girl進(jìn)入相戀階段;
        }
        void Boy::其他具備條件(char *another)
        {
        Boy目前擁有的除房子車子外條件=another;
        }
        bool Boy::贈(zèng)送禮物(Girl girl,char *gift)
        {
        if(Boy將禮物送給girl)
        return true;
        else
        return false;
        }
        long Boy::拼命賺錢()
        {
        Boy日夜操勞,兩眼發(fā)黑,為的是月末能拿到那可憐的鈔票;
        return 一年掙下的鈔票總數(shù);
        }
        Girl::Girl()
        {
        }
        Girl::~Girl()
        {
        }
        void Girl::戀愛(ài)(Boy boy)
        {
        與boy進(jìn)入相戀階段;
        }
        void Girl::嫁給(Boy boy)
        {
        同意嫁給boy,與boy步入神圣的婚姻殿堂;
        }
        void main( )
        {
        Boy theBoy;
        Girl theGirl;
        int year;
        long money;
        theBoy.年齡=25;
        theBoy.戀愛(ài)(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( 節(jié)日轉(zhuǎn)換(day) == 情人節(jié))
        {
        if( theBoy.贈(zèng)送禮物(theGirl,玫瑰))
        theGirl.感情++;
        else
        theGirl.感情--;
        }
        if( 日期轉(zhuǎn)換(day) == theGirl.生日)
        {
        if( theBoy.贈(zèng)送禮物(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.戀愛(ài)(anotherBoy);
        }
        }
        //注:以上代碼尚未編譯,請(qǐng)個(gè)人自行編譯運(yùn)行,哈哈,祝君順利
        相關(guān)推薦