哪里出錯了我找不到啊
public class HelloWorld {
? ? public static void main(String[] args) {
? ? int one = 20 ;
if(one!=0)
? ? {
? ? ? ? if(one%=0)
? ? ? ? {System.out.println("one是偶數(shù)");}
? ? else
? ? System.out.println("one不是偶數(shù)");}
? ? else
? ? System.out.println("one既不是奇數(shù)也不是偶數(shù)");
? ? }
}
2015-05-24
正確代碼
public class HelloWorld {
? ? public static void main(String[] args) {
int one = 20 ;
if(one%2==0)
? ? ? ?System.out.println("one是偶數(shù)");
}
}
2015-04-21
寫錯了。下次注意點(diǎn)
2015-04-01
?if(one%=0)
這個算式有意義么?