我不知道我的代碼哪里錯了,就是無法運行
public class HelloWorld {
? ? public static void main(String[] args) {
int one = 20 ;
? ? ? ? if(one%2==0){
? ? ? ? ? ? System.out.println("one是偶數");
? ? ? ? ? ? }
? ? ? ? else {
? ? ? ? ? ? System.out.println("one是奇數");
? ? ? ? ? ? }?
}
}
2015-08-28
System.out.println("one是偶數"); System.out.println("one是奇數");這2行最后的分號錯了,改成英文分號即可
public?class?HelloWorld?{ ????public?static?void?main(String[]?args)?{ ????????int?one?=?20?; ????????if(one%2==0){ ????????????System.out.println("one是偶數"); ????????}else?{ ????????????System.out.println("one是奇數"); ????????}? ????} }