婷婷色中文在线视频,思思热在线视频日本一区,欧美精品一区三区在线观看,日本色逼影音资源

  • <dfn id="pbiqm"><cite id="pbiqm"></cite></dfn>
        
        

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

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