为啥不能直接赋初值
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count=0;
for( count=1;(num/=10)>0;count++);
System.out.println("它是个"+count+"位的数!");
}
}
为啥不能去掉int count=0,直接for(int count=1.....
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count=0;
for( count=1;(num/=10)>0;count++);
System.out.println("它是个"+count+"位的数!");
}
}
为啥不能去掉int count=0,直接for(int count=1.....
2016-06-03
举报