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

            Jiwu Bu

              C++博客 :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
              32 隨筆 :: 0 文章 :: 25 評論 :: 0 Trackbacks
            轉載鏈接:http://blog.chinaunix.net/u2/76292/showart_1845022.html

             1 #include <stdlib.h>
             2 #include <stdio.h>
             3 #include <ctype.h>
             4 
             5 long my_atol(const char *nptr)
             6 {
             7     int c; /* current char */
             8     long total; /* current total */
             9     int sign; /* if '-', then negative, otherwise positive */
            10 
            11     /* skip whitespace */
            12     while ( isspace((int)(unsigned char)*nptr) )
            13     {
            14         ++nptr;
            15     }
            16     
            17     c = (int)(unsigned char)*nptr++;
            18     sign = c; /* save sign indication */
            19     if (c == '-' || c == '+')
            20     {
            21         c = (int)(unsigned char)*nptr++/* skip sign */
            22     }
            23     
            24     total = 0;
            25 
            26     while (isdigit(c)) 
            27     {
            28         total = 10 * total + (c - '0'); /* accumulate digit */
            29         c = (int)(unsigned char)*nptr++/* get next char */
            30     }
            31 
            32     if (sign == '-')
            33     {
            34        return -total;
            35     }
            36     else
            37     {
            38         return total; /* return result, negated if necessary */
            39     }
            40 }
            41 
            42 int  main(int argc, char* argv[])
            43 {
            44     if( argc < 2 )
            45     {
            46         return -1;
            47     }
            48 
            49     int i = my_atol(argv[1]);
            50     printf("[%s]====>[%d]\n", argv[1], i);
            51    
            52     int j = atoi(argv[1]);
            53     printf("[%s]====>[%d]\n", argv[1], j);
            54 
            55     return 0;
            56 }
            57 
            http://m.shnenglu.com/Files/bujiwu/atoi.rar

            posted on 2010-01-15 17:52 bujiwu 閱讀(1428) 評論(0)  編輯 收藏 引用 所屬分類: 算法與數(shù)據(jù)結構
            国产无套内射久久久国产| 久久亚洲高清观看| 久久精品国产精品亚洲| 欧美伊人久久大香线蕉综合69| 久久伊人精品一区二区三区| 久久福利青草精品资源站| 香港aa三级久久三级老师2021国产三级精品三级在 | 91精品国产91久久久久久| 一本综合久久国产二区| 久久99热国产这有精品| 国产精品欧美久久久久天天影视 | 亚洲愉拍99热成人精品热久久| 久久精品夜色噜噜亚洲A∨ | 亚洲欧美成人久久综合中文网 | 天天影视色香欲综合久久| 无码AV中文字幕久久专区| 久久亚洲精品国产亚洲老地址| 国产亚洲成人久久| 国产真实乱对白精彩久久| 久久精品卫校国产小美女| 亚洲欧美另类日本久久国产真实乱对白| 久久精品国产免费观看| 久久国产成人午夜AV影院| 97久久精品国产精品青草| 久久综合香蕉国产蜜臀AV| 欧美日韩精品久久久免费观看| 久久精品国产亚洲综合色| 亚洲精品国精品久久99热一| 久久婷婷五月综合97色直播| 天堂无码久久综合东京热| 精品久久久久久国产| 久久久一本精品99久久精品88| 久久国产高潮流白浆免费观看| 久久99这里只有精品国产| 久久亚洲2019中文字幕| 99精品伊人久久久大香线蕉| 久久久中文字幕| 日韩亚洲欧美久久久www综合网| 久久超碰97人人做人人爱| 91精品国产91久久久久福利| 少妇高潮惨叫久久久久久|