網頁
首頁
JAVA7筆記內容
JAVA7開發工具
電子書《程式語言》
被動收入APP下載
註冊送妳$50美金
關於站長Mike
2016年6月18日 星期六
//三元運算式辨別積數,偶數
public class ScoreLevel3 {
public static void main(String[] args) {
java.util.Scanner scanner =
new java.util.Scanner(System.in);
int input=scanner.nextInt();
int remain = input ;
System.out.println(input + " 是" +
((remain%2==0) ? "偶數" : "積數"));
//三元運算式辨別積數,偶數
}
}
沒有留言:
張貼留言
較新的文章
較舊的文章
首頁
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言