这样也可以
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
举报