• <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
            重要的是這個(gè)磨練過(guò)程,而不是結(jié)果,要的是你粗壯的腿,而不是你身上背的那袋鹽巴

             

            求得含有最多連續(xù)特定字符個(gè)數(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 閱讀(315) 評(píng)論(0)  編輯 收藏 引用 所屬分類: 算法+數(shù)據(jù)結(jié)構(gòu)

            導(dǎo)航

            留言簿(1)

            隨筆分類

            友情鏈接

            搜索

            最新隨筆

            最新評(píng)論

            閱讀排行榜

            怡红院日本一道日本久久| 久久精品男人影院| 久久精品无码一区二区日韩AV| 国产成人无码久久久精品一| 久久国产免费观看精品3| 无码专区久久综合久中文字幕| 囯产极品美女高潮无套久久久 | 7777精品伊人久久久大香线蕉| 成人精品一区二区久久| 国产福利电影一区二区三区久久老子无码午夜伦不 | 久久国产高潮流白浆免费观看| 亚洲va久久久噜噜噜久久天堂| 久久久久av无码免费网| 青草国产精品久久久久久| 91精品国产综合久久久久久| 99久久99久久精品国产| 久久精品国产亚洲Aⅴ蜜臀色欲 | 色综合久久88色综合天天| 久久久久亚洲AV无码专区网站| 奇米影视7777久久精品人人爽 | 久久久久亚洲av无码专区| 色综合久久中文色婷婷| 一本久久综合亚洲鲁鲁五月天亚洲欧美一区二区| 久久夜色精品国产亚洲av| 日韩人妻无码精品久久免费一| 久久中文字幕一区二区| 香蕉久久久久久狠狠色| 97久久国产亚洲精品超碰热| 免费一级做a爰片久久毛片潮| 色8久久人人97超碰香蕉987| 久久高清一级毛片| 久久精品国产亚洲AV电影| 久久国产综合精品五月天| 性做久久久久久久| 久久婷婷五月综合色99啪ak| 久久婷婷激情综合色综合俺也去| 久久久久香蕉视频| 久久国产精品成人免费| 中文字幕无码免费久久| 热久久国产欧美一区二区精品| 成人妇女免费播放久久久|