while循环 do-while循环
int x; 1.用户输入x; int x;
int n=0; 2.初始化n为0; int n=0;
scanf("%d",&x); 3.x=x/10,去掉个位; scanf("%d,&x");
n++; 4.n++ do{
x/=10; 5.如果x>0,回到3; x/=10;
while(x>0){ 6.否则n就是结果 n++;
n++; }while(x>0;)
x/=10; printf("%d",n);
}
printf("%d\n",n);
标签:do,10,int,++,while,循环 From: https://www.cnblogs.com/t0326/p/17060508.html