public static void main(String[] args) {
//左:宣告變數 sc,準備操控Scanner的記憶體
//右:新增記憶體,接收從鍵盤輸入的資料
Scanner sc = new Scanner(System.in);
System.out.println("請輸入身高");
//System.out.println(sc);
//將輸入的資料轉換成整數-->h
int h = sc.nextInt();
System.out.println(h);
if(h>=150) {
System.out.println("購買票數");
int t = sc.nextInt();
System.out.println("需購票進場,共計:"+(t*150)+"元");
}
else {
System.out.println("僅能玩普通設施");
System.out.println("票數?");
int t = sc.nextInt();
System.out.println("可優惠購票進場,共計:"+(t*100)+"元");
}
//----------------------------------
System.out.println("請輸入ID...");
String ID = sc.next();
char id01 = ID.toUpperCase().charAt(0);
System.out.println(id01);
if(id01=='A') {
System.out.println("黃金會員");
}else {
System.out.println("普通人員");
}
}
}
2019年7月18日 星期四
訂閱:
張貼留言 (Atom)
STM32
STM32 硬體腳位接線 : Keil 程式燒入操作 : 前置設定 開啟 Keil 工程檔案後,進入 Options for Target 設定頁面 。 在 Debug 分頁選取 ST-Link Debugger 作為燒錄器 。 點擊工具列的...
-
1. 先將 PostgreSQL 的 pg_hba.conf 做設定 notepad "C:\Program Files\PostgreSQL\15\data\pg_hba.conf" 在檔案中的最後一行加上 host all a...
沒有留言:
張貼留言