這個(gè)為什么沒有對啊 哪里錯(cuò)了 求大佬告知
public class HelloWorld{
? public static void main(String[] args){
? ? int num = 999;
? ? int count = 1;
? ? int i;
? ? for(i=10;count<10;count++){
? ? ? ? if(num<i){
? ? ? ? ? ? break;
? ? ? ? }
? ? ? ? i=i*10;
? ? }
? ? System.out.println("它是個(gè)"+count+"位的數(shù)");
? }
}
2017-03-20
????int num = 1234567890;?
????int count = 1;
??? int i;
??for(i=10;num>i;i=i*10){
??????if(count<9){
???????????count++;
??????}else{
???????????count = 0;
???????????break;
???????}
??}
??if(count!=0){
???????System.out.println("它是個(gè)"+count+"位的數(shù)");
??}else{
???????System.out.println("?數(shù)值過大無法判斷");
??}
2017-03-19
你還是學(xué)學(xué)for循環(huán)再考慮你這問題吧!