這樣也可以
public class HelloWorld { public static void main(String[] args) { ? ? ? int one = 21; ? ? String str=(one%2==0)?"偶數":"非偶數"; ? System.out.println(str); ? ? ? ? ? ? } }
public class HelloWorld { public static void main(String[] args) { ? ? ? int one = 21; ? ? String str=(one%2==0)?"偶數":"非偶數"; ? System.out.println(str); ? ? ? ? ? ? } }
2016-10-29
舉報
2016-10-29
可以。