求解,哪里出錯了
?public class HelloWorld{
?public static void main(String[] args){?
int num = 999;
int count = 0;?
for(count=0;num=999){
?? ?count++ ? ?
? ? num/10?
?? ?if(num/10==0); ? ??
System.out.println("它是個"+count+"位的數");
}
?public class HelloWorld{
?public static void main(String[] args){?
int num = 999;
int count = 0;?
for(count=0;num=999){
?? ?count++ ? ?
? ? num/10?
?? ?if(num/10==0); ? ??
System.out.println("它是個"+count+"位的數");
}
2017-02-21
舉報
2017-02-21
for循環用的不對?? ?,if那個可以省掉,for循環會幫你篩選的
public class Qiuweishu?
{
public static void main(String[] args)?
{
int num = 999;
? ? ? ? int count = 0;?
? ? ? ? for(;num!=0;count++){ ??
? ? ? ? ?num=num/10; } ? ?
? ? ? ? ? ?System.out.println("它是個"+count+"位的數");
}
}
2017-02-21
2017-02-21
循環沒有結束的條件(break),或者這一開始循環就結束了,int num=999???----for(count=0;num=999?????)
2017-02-21
for語句循環條件沒有