这是老师的答案,然而当把999换成10,你猜怎么着!这是个1位数?
int num = 10;
int count = 0;
if(num>=0&&num<=99999999){
while(num!=0){
count++;
num/=100;
}
System.out.println("它是个"+count+"位的数!");
}else{
System.out.println("输入有误!");
int num = 10;
int count = 0;
if(num>=0&&num<=99999999){
while(num!=0){
count++;
num/=100;
}
System.out.println("它是个"+count+"位的数!");
}else{
System.out.println("输入有误!");
2018-06-25
举报