• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            隨筆 - 87  文章 - 279  trackbacks - 0
            <2025年7月>
            293012345
            6789101112
            13141516171819
            20212223242526
            272829303112
            3456789

            潛心看書研究!

            常用鏈接

            留言簿(19)

            隨筆分類(81)

            文章分類(89)

            相冊(cè)

            ACM OJ

            My friends

            搜索

            •  

            積分與排名

            • 積分 - 217919
            • 排名 - 117

            最新評(píng)論

            閱讀排行榜

            評(píng)論排行榜

            #include? < iostream >
            #include?
            < string >
            using ? namespace ?std;

            typedef??
            long ? long ?_BigInt;
            const ? int ?BITSIZE? = ? 7000 ;
            const ? int ?EACHBITNUM? = ? 1000000000 ;
            class ?BIGINT
            {
            public :
            ????_BigInt?size;
            ????_BigInt?data[BITSIZE];
            ????BIGINT();
            ????BIGINT(
            string );
            ????BIGINT?
            operator = ( const ?BIGINT & );
            ????
            bool ? operator < ( const ?BIGINT? & );
            ????
            bool ? operator == ( const ?BIGINT? & );
            ????
            bool ? operator > ( const ?BIGINT? & );
            ????
            bool ? operator <= ( const ?BIGINT? & );
            ????
            bool ? operator >= ( const ?BIGINT? & );
            ????
            bool ? operator != ( const ?BIGINT? & );
            ????friend?BIGINT?
            operator + ( const ?BIGINT & ,? const ?BIGINT & );
            ????friend?BIGINT?
            operator - (BIGINT,?BIGINT);
            ????friend?BIGINT?
            operator * ( const ?BIGINT? & ,? const ?BIGINT? & );
            ????
            // friend?BIGINT?operator/(const?BIGINT?&,?const?BIGINT?&);
            ???? void ?print();
            }
            ;

            BIGINT::BIGINT()
            {
            ????size?
            = ? 0 ;
            ????memset(data,?
            0 ,? sizeof (data));
            }

            BIGINT::BIGINT(
            string ?s)
            {
            ????
            int ?i;
            ????
            int ?len? = ?s.length();
            ????
            int ?exp? = ? 1 ;
            ????_BigInt?tmp?
            = ? 0 ;
            ????size?
            = ? 0 ;
            ????memset(data,?
            0 ,? sizeof (data));
            ????
            for ?(i = len;?i >= 1 ;?i -- )
            ????
            {
            ????????tmp?
            += ?(s[i - 1 ]? - ? ' 0 ' )? * ?exp;
            ????????
            if ?(exp? == ?EACHBITNUM / 10 )
            ????????
            {????
            ????????????data[
            ++ size]? = ?tmp;
            ????????????tmp?
            = ? 0 ;
            ????????????exp?
            = ? 1 ;
            ????????}

            ????????
            else
            ????????????exp?
            *= ? 10 ;
            ????}

            ????
            if ?(tmp? != ? 0 )
            ????????data[
            ++ size]? = ?tmp;
            }

            BIGINT?BIGINT::
            operator = ( const ?BIGINT? & a)
            {
            ????
            int ?i;
            ????memset(data,?
            0 ,? sizeof (data));
            ????size?
            = ?a.size;
            ????
            for ?(i = 1 ;?i <= size;?i ++ )
            ????????data[i]?
            = ?a.data[i];
            ????
            return ? * this ;
            }

            void ?BIGINT::print()
            {
            ????
            int ?i;
            ????
            for ?(i = size;?i >= 1 ;?i -- )
            ????????
            if ?(i? != ?size)
            ???????????printf(
            " %.9lld " ,?data[i]);
            ????????
            else
            ???????????printf(
            " %lld " ,?data[i]);
            ????printf(
            " \n " );
            }

            bool ?BIGINT:: operator < ( const ?BIGINT? & a)
            {
            ?????
            int ?i;
            ?????
            if ?(size? < ?a.size)? return ? true ;
            ?????
            if ?(size? > ?a.size)? return ? false ;
            ?????
            for ?(i = 1 ;?i <= size;?i ++ )
            ?????????
            if ?(data[i]? >= ?a.data[i])? return ? false ;
            ?????
            return ? true ;?????
            }

            bool ?BIGINT:: operator == ( const ?BIGINT? & a)
            {
            ?????
            int ?i;
            ?????
            if ?(size? != ?a.size)? return ? false ;
            ?????
            for ?(i = 1 ;?i <= size;?i ++ )
            ?????????
            if ?(data[i]? != ?a.data[i])? return ? false ;
            ?????
            return ? true ;
            }

            bool ?BIGINT:: operator > ( const ?BIGINT? & a)
            {
            ?????
            int ?i;
            ?????
            if ?(size? > ?a.size)? return ? true ;
            ?????
            if ?(size? < ?a.size)? return ? false ;
            ?????
            for ?(i = 1 ;?i <= size;?i ++ )
            ?????????
            if ?(data[i]? <= ?a.data[i])? return ? false ;
            ?????
            return ? true ;??
            }

            bool ?BIGINT:: operator >= ( const ?BIGINT? & a)
            {
            ?????
            return ? ! (( * this )? < ?a);
            }

            bool ?BIGINT:: operator <= ( const ?BIGINT? & a)
            {
            ?????
            return ? ! (( * this )? > ?a);
            }

            bool ?BIGINT:: operator != ( const ?BIGINT? & a)
            {
            ?????
            return ? ! (( * this )? == ?a);
            }

            BIGINT?
            operator + ( const ?BIGINT? & a,? const ?BIGINT? & b)
            {
            ????BIGINT?rnt;
            ????
            int ?i;
            ????
            bool ?t? = ? false ;
            ????_BigInt?tmp;
            ????
            int ?len? = ?a.size? > ?b.size? ? ?a.size?:?b.size;
            ????
            for ?(i = 1 ;?i <= len;?i ++ )
            ????
            {
            ????????tmp?
            = ?a.data[i]? + ?b.data[i];
            ????????
            if ?(t)?tmp? += ? 1 ;
            ????????t?
            = ? false ;
            ????????
            if ?(tmp? >= ?EACHBITNUM)
            ????????
            {
            ????????????tmp?
            -= ?EACHBITNUM;
            ????????????t?
            = ? true ;
            ????????}

            ????????rnt.data[
            ++ rnt.size]? = ?tmp;
            ????}

            ????
            if ?(t)?rnt.data[ ++ rnt.size]? += ? 1 ;?
            ????
            return ?rnt;
            }

            BIGINT?
            operator - (BIGINT?a,?BIGINT?b)
            {
            ????BIGINT?rnt;
            ????
            int ?i;
            ??????
            // ?if?(a?<?b)?return?rnt;
            ???? for ?(i = 1 ;?i <= a.size;?i ++ )
            ????
            {
            ????????
            if ?(a.data[i]? < ?b.data[i])
            ????????
            {
            ????????????a.data[i
            + 1 ] -- ;
            ????????????a.data[i]?
            += ?EACHBITNUM;
            ????????}

            ????????rnt.data[
            ++ rnt.size]? = ?a.data[i]? - ?b.data[i];
            ????}

            ????
            return ?rnt;
            }

            BIGINT?
            operator * ( const ?BIGINT? & a,? const ?BIGINT? & b)
            {
            ????
            int ?i,?j;
            ????BIGINT?rnt;
            ????_BigInt?tmp;
            ????
            for ?(i = 1 ;?i <= a.size;?i ++ )
            ????????
            for ?(j = 1 ;?j <= b.size;?j ++ )
            ????????
            {
            ????????????tmp?
            = ?a.data[i]? * ?b.data[j];
            ????????????rnt.data[i
            + j - 1 ]? += ?tmp;
            ????????????rnt.data[i
            + j]? += ??rnt.data[i + j - 1 ]? / ?EACHBITNUM;
            ????????????rnt.data[i
            + j - 1 ]? %= ?EACHBITNUM;
            ????????}

            ????
            for ?(i = BITSIZE - 1 ;?i >= 1 ;?i -- )
            ????????
            if ?(rnt.data[i]? > ? 0 ? || ?i? == ? 1 )
            ????????
            {
            ????????????rnt.size?
            = ?i;
            ????????????
            break ;
            ????????}

            ????
            return ?rnt;
            }


            int ?main()
            {????
            ????
            int ?n;
            ????
            int ?i;
            ????BIGINT?one(
            " 1 " );
            ????BIGINT?y(
            " 1 " );
            ????cin?
            >> ?n;

            ????
            for ?(i = 1 ;?i <= n;?i ++ )
            ????
            {
            ????????y?
            = ?y? + ?one;
            ????????y.print();
            ????????y?
            = ?y? * ?(y? - ?one);
            ????}

            ????system(
            " pause " );
            ????
            return ? 0 ;
            }

            posted on 2006-09-03 04:29 閱讀(539) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 數(shù)據(jù)結(jié)構(gòu)與算法
            久久九九亚洲精品| 狠狠色丁香久久婷婷综合蜜芽五月 | 亚洲国产精品无码久久一线| 无码人妻精品一区二区三区久久久| 久久精品中文闷骚内射| 婷婷综合久久狠狠色99h| 久久笫一福利免费导航| 国产亚洲精品美女久久久| 亚洲?V乱码久久精品蜜桃| 国内精品久久久久影院免费| 青青热久久国产久精品| 久久亚洲精品中文字幕| 无码8090精品久久一区| 久久久久国产精品| 九九精品99久久久香蕉| 中文精品久久久久人妻| 国产精品丝袜久久久久久不卡| 久久综合给合久久狠狠狠97色| 理论片午午伦夜理片久久| 99久久婷婷国产综合精品草原 | 久久精品国产亚洲AV无码娇色| 91精品无码久久久久久五月天| 天天爽天天狠久久久综合麻豆| 一本久久a久久精品综合香蕉| 中文字幕成人精品久久不卡| 成人妇女免费播放久久久| 99久久精品国产一区二区| 亚洲国产日韩欧美综合久久| 久久久精品视频免费观看| 99久久精品九九亚洲精品| 亚洲伊人久久大香线蕉苏妲己| 欧美喷潮久久久XXXXx| 少妇久久久久久被弄高潮| 亚洲精品乱码久久久久久中文字幕 | 国产精品美女久久福利网站| 久久综合成人网| 四虎久久影院| 久久亚洲中文字幕精品一区| 免费精品久久天干天干| 国内精品九九久久精品| 久久精品中文闷骚内射|