為什么會(huì)說(shuō)我輸出錯(cuò)誤呢?輸出結(jié)果就是:它是個(gè)3位數(shù)!
public class HelloWorld{
public static void main(String[] args){
final long N=999;
long num = N;
int count = 0;
if(num==0)
{
? ? count++;
}
else if(num!=0)
{
? ? for(;num<1000000000;num=num*10)
? ? {
? ? ? ? count++;
? ? }
? ? count=10-count;
? ? num=N;
}
System.out.println("它是個(gè)"+count+"位的數(shù)! ");
}
}
2019-03-31
好吧,我知道了,那個(gè)感嘆號(hào)要用中文的感嘆號(hào)!。。。