我按著參考代碼打的呀 為什么還是出錯了
public class HelloWorld {
? ? public static void main(String[] args) {
int one = 20 ;
if(one%2=0){
? ? 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ù)");
}
? ??
? ??
? ??
? ??
}
}
2020-11-25
舉報
2020-11-25
比較是否相等使用 == ,=是賦值
2020-11-25
one%2==0
2020-11-25
=是賦值,==才是比較