可以这样写吧
public class myOne { public static void main(String[] args){ int one = 21 ; String hu = (one%2==0)?"偶数":"奇数"; System.out.println("one是"+hu); } }
public class myOne { public static void main(String[] args){ int one = 21 ; String hu = (one%2==0)?"偶数":"奇数"; System.out.println("one是"+hu); } }
2016-07-24
举报