• <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>

            C++ Jounior

            once setback,once inspiration,once self-awareness
            重要的是這個磨練過程,而不是結(jié)果,要的是你粗壯的腿,而不是你身上背的那袋鹽巴

             

            求得含有最多連續(xù)特定字符個數(shù)的字符串

            int ?GetMaxCountofContinuousLetter( char ? * ?p, char ?searchChar)
            {
            ????
            int ?maxCount? = 0 ;
            ????
            int ?currentCount? = ? 0 ;
            ????
            while ( 1 )
            ????
            {
            ????????
            if ( * p? == ?searchChar)
            ????????
            {
            ????????????currentCount?
            = ? 0 ;
            ????????????
            while ( * p? && ? * p? == ?searchChar)
            ????????????
            {
            ????????????????currentCount?
            ++ ;
            ????????????????p
            ++ ;
            ????????????}

            ????????????
            if (maxCount? < ?currentCount)
            ????????????????maxCount?
            = ?currentCount;
            ????????}

            ????????
            if ( * p? == ? ' \0 ' )?
            ????????????
            break ;
            ????????
            else
            ????????????p
            ++ ;
            ????}

            ????
            return ?maxCount;
            }

            int ?main()?????
            {??
            ????
            char ? * p[ 3 ] =
            ????
            {
            ????????
            " String(1)8818882348888856788888888988888888880 " ,
            ????????
            " String(2)881888234888885678888888898888888880 " ,
            ????????
            " String(3)8818882348888856788888888988888888888888880 "
            ????}
            ;
            ????
            int ?location? = ? 0 ;
            ????
            char ?searchChar? = ? ' 8 ' ;
            ????
            int ?tempCount? = ? 0 ;
            ????
            int ?maxCount? = ? 0 ;
            ????
            for ( int ?i? = ? 0 ;i < sizeof (p) / sizeof ( * p);i ++ )
            ????
            {
            ????????tempCount?
            = ?GetMaxCountofContinuousLetter(p[i],searchChar);
            ????????
            if (?tempCount? > ?maxCount)
            ????????
            {
            ????????????maxCount?
            = ?tempCount;
            ????????????location?
            = ?i;
            ????????}

            ????}

            ????cout
            << " the?string?of?maxCount?is?:? " << p[location] << endl;
            ????cout
            << " the?count?of??the?continuous?letters?is?:? " << maxCount << endl;
            ????cin.
            get ();
            }

            posted on 2008-04-02 09:30 snowball 閱讀(325) 評論(0)  編輯 收藏 引用 所屬分類: 算法+數(shù)據(jù)結(jié)構(gòu)

            導航

            留言簿(1)

            隨筆分類

            友情鏈接

            搜索

            最新隨筆

            最新評論

            閱讀排行榜

            日韩久久无码免费毛片软件| 精品无码久久久久久久久久| 国产偷久久久精品专区| 天天躁日日躁狠狠久久| 久久亚洲国产中v天仙www| 久久久久噜噜噜亚洲熟女综合| 国产精品久久新婚兰兰| 99久久精品费精品国产一区二区| 国产午夜福利精品久久| 亚洲伊人久久大香线蕉综合图片 | AAA级久久久精品无码片| 青青草原综合久久| 伊人久久精品无码av一区| 精品久久综合1区2区3区激情| 奇米影视7777久久精品| 欧美粉嫩小泬久久久久久久| 国产精品免费看久久久| 亚洲愉拍99热成人精品热久久 | 国产亚洲色婷婷久久99精品91| 久久99热这里只频精品6| 久久亚洲欧美日本精品| 人妻无码αv中文字幕久久| 青青热久久国产久精品 | 99久久精品日本一区二区免费| 亚洲伊人久久综合中文成人网| 办公室久久精品| 中文字幕亚洲综合久久| 99久久国产亚洲高清观看2024| 国产精品久久一区二区三区| 久久久噜噜噜www成人网| 日本强好片久久久久久AAA| 欧美久久一级内射wwwwww.| 久久国产精品久久精品国产| 国内精品久久久久影院免费| 国产一区二区三区久久精品| 日本精品久久久久中文字幕8| 久久Av无码精品人妻系列| 亚洲午夜久久久久久噜噜噜| 久久影院综合精品| 国产日产久久高清欧美一区| 免费观看成人久久网免费观看|