虽然运行正确,但是我总感觉有问题,各位同学帮忙看看可以吗~
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
for(;count<10; count++){
if(num/10==0)
{
System.out.println("它是个"+(count+1)+"位的数!");
break;
}
num = num/10;
}
}
}
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
for(;count<10; count++){
if(num/10==0)
{
System.out.println("它是个"+(count+1)+"位的数!");
break;
}
num = num/10;
}
}
}
2019-05-26
举报