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