哪個大神看看這個是怎么錯的,老是提示輸出錯誤
public class HelloWorld{ public static void main(String[] args)
{
?int num = 999;?
int count = 0;?
if(num<999999999&&num>=0){ ? ?
while(num!=0){ ? ? ? ?
count++; ? ? ??
?num/=10; ? ?} ? ?
System.out.println("它是個"+ count + "位的數(shù)");
?}else{ ? ?System.out.println("輸入錯誤!");
?} } }?
2019-03-14
結(jié)尾多了個大括號
2019-03-14
輸出語句有問題,缺少個感嘆號。用這個吧
? System.out.println("它是個"+count+"位的數(shù)!");
2019-03-14
多個括號,你格式化下代碼,就能看清楚了