最新回答 / qq_慕運維0383977
首先代碼中else拼寫錯誤,其次,正式開發中判斷是否為偶數最好是這樣,a != 0(a不等于0)因為要考慮到負數的情況????????????????if(a!=0){ ? ? System.out.println("one是偶數,"+a); }else{ ? ?? ? ? System.out.println("one不是偶數,"+a); }
2022-08-28
最贊回答 / 慕神5565120
public class HelloWorld{? ? public static void main(String[] args) { String hobby="慕課網"; System.out.println(hobby); }}
2022-08-26
最贊回答 / weixin_慕絲2561621
我的我的突然反應過來了第7和第18行是不應該有“}”的符號的不然就會出現符號混亂,通過刪除兩段多余的“}”就可以在不刪除else的情況下分類輸出是否進入決賽以及是否進入對應的女子決賽的信息。所以如果既要打印進入決賽又要打印進入女子決賽的結果應該如下(如果要只輸出或打印進入女子決賽的信息只要刪除if判斷句以及else輸出句子之后的打印結果即可,也就是結果僅為進入女子決賽)public class HelloWorld {??? public static void main(String[] args) {...
2022-08-25
最贊回答 / 慕勒9145778
public class HelloWorld{????public? static void main(String[] args){????????double a=(3*8+11)/4;????????System.out.println(((int)a%3));????}}
2022-08-25
最新回答 / 劉3535446
? ? ?int num = (int) 8754983;? ? ? ? int counter = 0;? ? ? ? if (num>=999999999||num < 1) {? ? ? ? ? ? System.out.println("請輸入一個小于十位數并且大于或等于1的數");? ? ? ? } else {? ? ? ? ? ? do {? ? ? ? ? ? ? ? counter++;? ? ? ? ? ? ? ? num = num / 10;? ? ? ? ? ? } ...
2022-08-19
最新回答 / 清醒著沉淪
public class HelloWorld{public static void main(String[] args){int num = -999;int count = 0;if(num >=0 && num <1000000000){? ? while(num!=0)? ? {? ? ? ? count++;? ? ? ? num = num/10;? ? }? ? System.out.println("它是個"+count+"位的數");}else{System...
2022-08-19
最新回答 / weixin_慕娘4490471
public class HelloWorld{? ? public static void main(String[] args) { ? ? int one=10;? ? ? ? int two=20;? ? ? ? int three=0;? ? ? ? ? ? three = one+two;? ? ? ? ? ? System.out.println("three=one+two==>"+three);? ? ? ? ? ? ? ? three = three+=one;? ? ? ? ?...
2022-08-16
最新回答 / 慕的地3404811
無法解析C:\Users\nick\IdeaProjects\untitled1\.idea\misc.xml這個文件,可能是你這個項目出現問題了,或者idea
2022-08-12
最贊回答 / weixin_慕標6191237
if (max<nums[i]){? ? max = nums[i];}比他大的數會替換掉原來的最大值,所以循環下來就只會等于數組中最大那個
2022-08-11