寫成int a為啥不可以??????
public class HelloWorld { ? ?public static void main(String[] args) { int one = 20 ; ? ? ? ?int a=20%2 if(a==0){ ? ? System.out.println("one是偶數(shù)"); ? }else{ ? ? System.out.println("one是奇數(shù)"); ? } ? ? ? ? ? ? ? ? } }寫成int a為啥不可以??????
2016-03-30
啥意思
public class Hellow {
public static void main(String[] args) {?
int one = 20 ;?
int a=one%2 ;
if(a==0){?
System.out.println("one是偶數(shù)"); ?
}else{?
System.out.println("one是奇數(shù)"); ??
} ? ? ? ? ? ? ? ?
}?
}
2016-03-30
你在int a=20%2 后面少打了一個分號