• <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://www.shnenglu.com/Files/bujiwu/atoi.rar

            posted on 2010-01-15 17:52 bujiwu 閱讀(1436) 評論(0)  編輯 收藏 引用 所屬分類: 算法與數據結構
            日韩精品无码久久久久久| 国产精品免费福利久久| 69SEX久久精品国产麻豆| 精品久久无码中文字幕| 2021久久精品国产99国产精品| 久久91综合国产91久久精品| 久久免费视频网站| 一本色道久久88综合日韩精品 | 久久伊人精品青青草原高清| 亚洲综合婷婷久久| 色天使久久综合网天天| 久久精品国产久精国产思思| 国产精品九九久久精品女同亚洲欧美日韩综合区| 88久久精品无码一区二区毛片| 中文字幕精品无码久久久久久3D日动漫 | 国产精品伦理久久久久久| 久久青青色综合| 久久精品国产99国产精偷 | 久久九九有精品国产23百花影院| 国产一区二区精品久久岳| 午夜精品久久久久久久久| 国产精品99久久久久久www| 久久久久av无码免费网| 久久精品无码一区二区app| 99久久超碰中文字幕伊人| 97精品伊人久久大香线蕉| 国产福利电影一区二区三区久久老子无码午夜伦不 | 久久精品国产亚洲AV无码娇色| 精品久久久久久久中文字幕| 久久午夜伦鲁片免费无码| 伊人久久无码精品中文字幕| 久久精品成人一区二区三区| 国产亚洲精品自在久久| 久久久久久久女国产乱让韩| 亚洲成av人片不卡无码久久| 久久99精品久久久久久久不卡| 中文字幕久久久久人妻| 久久笫一福利免费导航 | 中文字幕成人精品久久不卡 | 国产精品成人久久久久三级午夜电影 | 国内精品久久久久久久涩爱|