打印int最大值

来源:互联网 发布:小公司网络拓扑图 编辑:程序博客网 时间:2024/04/25 22:42
#include <stdio.h>
#include <stdlib.h>


int main()
{

    unsigned int a,step;


    long long int b;
    step = 1000000;
    a = 0;
    b= a+step;


    while(1)
    {
        while(b==a+step)
        {
            a += step;
            b += step;
        }
        if(step == 1) break;
        a = b-step;
        step = step/10;
        b = a + step;
    }
    printf("%u",a);
    return 0;
}