這個哪錯誤了
public class HelloWorld {
? ? public static void main(String[] args) {
int one = 20 ;
if(one/2==0){
? ? System.out.println("one 為偶數(shù)");
}else{
? ? System.out.println("one 為奇數(shù)");
}
? ? }
}
public class HelloWorld {
? ? public static void main(String[] args) {
int one = 20 ;
if(one/2==0){
? ? System.out.println("one 為偶數(shù)");
}else{
? ? System.out.println("one 為奇數(shù)");
}
? ? }
}
2018-07-13
舉報
2018-07-27
System.out.println("one 為偶數(shù)"); 輸出的時候在雙引號中的所有內(nèi)容都是字符串,你這里面的one不是變量。
2018-07-16
您這不是應(yīng)該判斷余數(shù)是否為零?為什么要取整?
2018-07-13
o.o我知道了早知道看下一篇的了