求大神看看哪錯(cuò)了
public class HelloWorld{
public static void main(String[] args){
int num = 999;
int count = 0;
int i=1;
for(j=1;j<=10;j++)
{
? ? if((num/i)!=0){
? ? ? ? count++;
? ? ? ? i*=10;
? ? }
? ? else{
? ? ? ? System.out.println("它是個(gè)");
? ? ? ? System.out.println(count);
? ? ? ? System.out.println("位的數(shù)!");
? ? ? ? break;
? ? }
}
}
}
2017-02-21
2017-02-20
? i*=10;
改成i/10;