第四章3

#include<stdio.h>
int main(void)
{
    int count,number;
    
    count=0;
    printf("Enter a number:");
    scanf("%d",&number);
    if(number<0)number=-number;
    do{
        number=number/10;
        count++;
    }while(number!=0);
    printf("It contains %d digits.\n",count);
    
    return 0;
}

posted @ 2013-10-05 14:52  执于一念  阅读(90)  评论(0编辑  收藏  举报