当前位置: 移动技术网 > IT编程>开发语言>C/C++ > 数数的位数(正整数)

数数的位数(正整数)

2018年08月15日  | 移动技术网IT编程  | 我要评论

妙高山,薛蛮子老婆丁玮,深圳锐启达能

#include <stdio.h>
int main()
{
    int a;
    scanf("%d",&a);
    int n=1;
    a=a/10;
    while(a>0)
    {
        a=a/10;
        n++;
        }    
    printf("%d",n);
}

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网