• <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 閱讀(1430) 評論(0)  編輯 收藏 引用 所屬分類: 算法與數據結構
            精品国产乱码久久久久久1区2区 | 久久se精品一区二区影院| 亚洲中文字幕无码久久综合网| 日韩精品无码久久一区二区三 | 一本久久a久久精品亚洲| 久久久久亚洲av成人无码电影| 大美女久久久久久j久久| 国产日韩欧美久久| 青青久久精品国产免费看| 久久久久免费视频| 亚洲国产精品成人久久蜜臀| 亚洲日本va午夜中文字幕久久| 久久不见久久见免费影院www日本| 久久99国产精品成人欧美| 人妻无码久久精品| 狠狠色丁香久久婷婷综合蜜芽五月| 香蕉久久夜色精品国产2020| 亚洲愉拍99热成人精品热久久| 久久一日本道色综合久久| 日本久久久精品中文字幕| 久久久艹| 亚洲国产欧美国产综合久久| 久久99国产精品久久| 日本精品久久久久久久久免费| 久久久久久久久久久精品尤物 | 久久99国产亚洲高清观看首页| 曰曰摸天天摸人人看久久久| 亚洲国产精品无码久久九九| 午夜不卡久久精品无码免费| 久久99热这里只有精品国产| 久久66热人妻偷产精品9| 久久精品国产精品亜洲毛片| 性做久久久久久久| 国产福利电影一区二区三区久久老子无码午夜伦不 | 久久综合九色综合久99| 久久亚洲国产最新网站| 久久er国产精品免费观看2| 国产精品中文久久久久久久 | 久久精品视频免费| 欧美va久久久噜噜噜久久| 欧美激情精品久久久久久久九九九 |