简单判断一个整数有几位,正确打开方式

#include<stdio.h>

int main()
{
    int x,i;
    scanf("%ld",&x);
    for(i=0;x>0;i++)
    x/=10;
    if(x==0)
    printf("%d",i);
    return 0;
}

原文地址:https://www.cnblogs.com/bin007/p/9873740.html