• <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++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
              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 閱讀(1436) 評論(0)  編輯 收藏 引用 所屬分類: 算法與數據結構
            久久久国产精品福利免费| 99久久无码一区人妻| 久久亚洲国产成人影院网站| 久久久久久久久久免免费精品| 伊人情人综合成人久久网小说| 亚洲va久久久噜噜噜久久狠狠| 国内精品伊人久久久久av一坑| 国产99久久久国产精品~~牛| 久久九九久精品国产免费直播| 久久最新精品国产| 97精品依人久久久大香线蕉97| 久久97久久97精品免视看秋霞| 97精品依人久久久大香线蕉97| 国产精品成人99久久久久91gav| 无码人妻久久一区二区三区免费丨 | 久久久久亚洲av无码专区导航| 亚洲国产成人久久综合一| 久久精品国产欧美日韩99热| 久久久久免费精品国产| 国内精品伊人久久久久777| 久久精品亚洲福利| 99久久综合国产精品二区| 久久精品午夜一区二区福利| 久久久亚洲裙底偷窥综合| 久久亚洲AV永久无码精品| 国产99久久久国产精品~~牛| 久久婷婷五月综合97色一本一本| 日本精品久久久久久久久免费| 99久久夜色精品国产网站| 久久99免费视频| 996久久国产精品线观看| 久久精品中文字幕无码绿巨人| 国产精品久久婷婷六月丁香| 亚洲欧美国产日韩综合久久 | 美女写真久久影院| 91久久精品91久久性色| a高清免费毛片久久| 久久青草国产精品一区| 国产AⅤ精品一区二区三区久久 | 国产香蕉久久精品综合网| 久久久精品国产|