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

            子彈 の VISIONS

            NEVER back down ~~

            C++博客 首頁 新隨筆 聯系 聚合 管理
              112 Posts :: 34 Stories :: 99 Comments :: 0 Trackbacks
            ?1 // ?created?by?ztwaker?on?2006-8-10
            ?2 // ?Used?for:?email
            ?3
            ?4 #include? < iostream >
            ?5 #include? < string >
            ?6 #include? < algorithm >
            ?7 using ? namespace ?std;
            ?8
            ?9 inline? bool ?isbegch( const ? int ?c)
            10 {
            11 ???? return ?(?c? == ? ' _ ' ? || ?(c? >= ? ' A ' ? && ?c? <= ? ' Z ' )? || ?
            12 ????????????(c? >= ? ' a ' ?? && ?c? <= ? ' z ' )?);
            13 }

            14
            15 inline? bool ?isfolch( const ? int ?c)
            16 {
            17 ???? return ?(?c? == ? ' _ ' ? || ?c? == ? ' . ' ? || ?(c? >= ? ' A ' ? && ?c? <= ? ' Z ' )? || ?
            18 ????????????(c? >= ? ' a ' ?? && ?c? <= ? ' z ' )? || ?(c? >= ? ' 0 ' ? && ?c? <= ? ' 9 ' )?);
            19 }

            20
            21 bool ?isValidName( const ? string & ?name)
            22 {
            23 ????typedef? string ::const_iterator??SIT;
            24 ????????
            25 ????SIT?it? = ?name.begin();????
            26 ???? if ?( ! isbegch(static_cast < int > ( * it)))? return ? false ;
            27 ???? for ?(;it? != ?name.end();? ++ it)
            28 ???? {
            29 ???????? if ?( ! isfolch(static_cast < int > ( * it)))? return ? false ;
            30 ????}

            31 ????
            32 ???? return ? true ;
            33 }

            34
            35 bool ?isValidDomain( const ? string & ?domain)
            36 {
            37 ????typedef? string ::const_iterator??SIT;
            38 ???? for ?(SIT?it? = ?domain.begin();?it? != ?domain.end();? ++ it)
            39 ???? {
            40 ???????? if ?( ! isfolch(static_cast < int > ( * it)))? return ? false ;
            41 ????}

            42 ????
            43 ???? return ? true ;
            44 }

            45
            46
            47 void ?getMail( const ? string & ?eml,? string & ?name,? string & ?domain)
            48 {
            49 ???? if ?( string ::npos? != ?eml.find( " @ " ))
            50 ???? {
            51 ????????name??? = ?isValidName(eml.substr( 0 ,?eml.find( " @ " )))? ? ?
            52 ????????????eml.substr( 0 ,?eml.find( " @ " ))?:? "" ;
            53 ????????
            54 ????????domain? = ?isValidDomain(eml.substr(eml.find( " @ " ) + 1 ,?eml.size() - eml.find( " @ " )))? ?
            55 ????????????eml.substr(eml.find( " @ " ) + 1 ,?eml.size() - eml.find( " @ " ))?:? "" ;
            56 ????}

            57 }

            58
            59
            60 void ?test()
            61 {
            62 ???? const ? string ?eml? = ? " waker615@163.com " ;
            63 ???? string ?name,?domain;
            64 ????getMail(eml,?name,?domain);
            65 ????cout? << ?name.c_str()? << ? " @ " ? << ?domain.c_str()? << ?endl;????
            66 }

            67
            68 int ?main()
            69 {
            70 ????test();
            71 ???? return ? 0 ;
            72 }
            posted on 2006-08-10 18:09 子彈のVISIONS 閱讀(291) 評論(1)  編輯 收藏 引用

            Feedback

            # re: [OPPD] Email 判斷[未登錄] 2007-05-10 18:48 galaxy
            學習, 看出你對stl 理解不錯
              回復  更多評論
              

            精品国产乱码久久久久久浪潮| 久久久久久国产精品免费无码| 欧美亚洲色综久久精品国产| 久久久精品2019免费观看| 国产精品久久波多野结衣| 亚洲国产精品久久久久久| 亚洲国产成人久久精品99| 99久久99久久久精品齐齐| 久久国产美女免费观看精品| 综合人妻久久一区二区精品| 91精品国产综合久久四虎久久无码一级| 一本一道久久精品综合| 久久久亚洲欧洲日产国码是AV | 日韩av无码久久精品免费| 久久精品男人影院| 久久久精品国产sm调教网站| 办公室久久精品| 国产伊人久久| 九九久久自然熟的香蕉图片| 中文精品久久久久人妻| 国产精品久久久天天影视| 久久精品国产亚洲AV不卡| 欧美精品福利视频一区二区三区久久久精品| 99精品国产在热久久无毒不卡| 女同久久| 国产精品99久久不卡| 2021国产成人精品久久| 久久精品亚洲精品国产色婷| 91麻豆国产精品91久久久| 久久午夜免费视频| 成人综合久久精品色婷婷| 久久夜色精品国产| 久久影院久久香蕉国产线看观看| 国产精品久久影院| 99国产精品久久久久久久成人热| 日韩人妻无码精品久久免费一| 久久久国产精华液| 色青青草原桃花久久综合| 精品伊人久久久| 伊人久久综合精品无码AV专区| 7777精品久久久大香线蕉|