有大佬知道为什么输出的是324么?
public class HelloWorld{
public static void main(String[] args){
double num = 0.9;
int count = 0;
if(num>0){
for(;num>0;){
num/=10;count=++count;
}System.out.print(count);
}else{
System.out.println("输入有误");
}
}
}
public class HelloWorld{
public static void main(String[] args){
double num = 0.9;
int count = 0;
if(num>0){
for(;num>0;){
num/=10;count=++count;
}System.out.print(count);
}else{
System.out.println("输入有误");
}
}
}
2021-01-09
举报