三种方法,三种结果?
int num=999;
int count=0;
if(num/10!=0){
num=num/10;
count++;
}
System.out.println(count)
-----------
int count = 0;
for (int num = 999; num / 10 > 0; num = num / 10)
{
count++;
}
System.out.println(count);
-----------
int num = 999;
int count = 0;
for(;count<10;count++)
{
num=num/10;
count++;
}while(num%10!=0);
System.out.println(count);