改錯(cuò)大神來
public class HelloWorld {
? ? public static void main(String[] args) {
int one = 21 ;
? ? ? ? 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 = 21 ;
? ? ? ? if(one%2==0){
? ? ? ? System.out.println("one是偶數(shù)");
} else{
? ? System.out.println("one不是偶數(shù)");
? ??
? ??
? ??
? ??
}
}
2016-04-01
舉報(bào)
2016-05-11
。。。。。后面少了}。
要不就直接不要else后面的了。
2016-04-04
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ù)");
? ? ? ? }
? ? }
}
2016-04-04
你結(jié)尾少了一個(gè)}
2016-04-01
one%2=0
2016-04-01
不需要絕對等于,one%2=0就行了!