• <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)  編輯 收藏 引用 所屬分類: 算法與數據結構
            国内精品久久久久影院亚洲| 人妻久久久一区二区三区| 一本久道久久综合狠狠爱| 思思久久精品在热线热| 久久综合精品国产二区无码| 7777久久亚洲中文字幕| 国产成人无码精品久久久久免费| 青青青国产精品国产精品久久久久| 99久久婷婷国产一区二区| 久久国产综合精品五月天| 亚洲AV日韩AV天堂久久| 久久99精品久久久久久不卡| 久久乐国产综合亚洲精品| 7国产欧美日韩综合天堂中文久久久久 | 一级做a爰片久久毛片免费陪| 亚洲欧美日韩中文久久| 久久久久国产精品麻豆AR影院| 国产∨亚洲V天堂无码久久久| 久久精品极品盛宴观看| 欧美粉嫩小泬久久久久久久 | 欧美黑人激情性久久| 日本国产精品久久| 欧美午夜A∨大片久久 | 国产成人精品久久二区二区| 久久精品aⅴ无码中文字字幕重口| 一本久久知道综合久久| 久久夜色精品国产噜噜麻豆| 久久精品国产网红主播| 久久超碰97人人做人人爱| 久久91精品国产91久久小草 | 久久www免费人成精品香蕉| 久久精品国产清自在天天线| 欧美精品福利视频一区二区三区久久久精品 | 久久香综合精品久久伊人| 国产∨亚洲V天堂无码久久久| 久久这里只有精品久久| 欧美日韩成人精品久久久免费看| 久久九九免费高清视频| 久久精品这里热有精品| 国产精品久久久久久久app| 久久精品成人免费看|