freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內容

languagebasics-資料下載頁

2025-07-17 15:38本頁面
  

【正文】 ore = (args[0])。 if (Score = 60) (“pass!)。 else (“fail!)。 } } National Taiwan University Department of Computer Science and Information Engineering 48 Control Flow Statements – ifelse Example: public class Age { public static void main (String[] args) { int x = (args[0])。 if(x=20 amp。amp。 x=29) (二年級 )。 else if(x=30 amp。amp。 x=39) (三年級 )。 else (四年級 )。 } } National Taiwan University Department of Computer Science and Information Engineering 49 Control Flow Statements – switchcase switch statement 適用場合:多重 ifthenelse敘述 case 文數(shù)字: ? case 後方只能接字元或整數(shù) ? 如: case 1: 或 case ?a?: ? 不可填入一個範圍 break。 ? break 指令可以阻止程式繼續(xù)往下執(zhí)行,並跳出整個 switchcase 結構 switch(expression){ case value1: statements… break。 case value2: statements… break。 … default: statements… break。 } National Taiwan University Department of Computer Science and Information Engineering 50 Control Flow Statements – switchcase Example: switch (month) { case 1: (January)。 break。 case 2: (February)。 break。 case 3: (March)。 break。 … case 10: (October)。 break。 case 11: (November)。 break。 case 12: (December)。 break。 default: (Not a month!)。 break。 } National Taiwan University Department of Computer Science and Information Engineering 51 Control Flow Statements – switchcase Example: public class GetMonthDays { public static void main (String[] args) { int Year = (args[0])。 int Month = (args[1])。 switch (Month) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: (31 days)。 break。 執(zhí)行: java GetMonthDays 2022 10 結果: 31 days National Taiwan University Department of Computer Science and Information Engineering 52 Control Flow Statements – switchcase case 4: case 6: case 9: case 11: (30 days)。 break。 case 2: if ( ((Year%4 == 0) amp。amp。 (Year%100 != 0)) || (Year%400 ==0) ) (29 days)。 else (28 days)。 break。 } // end of switch } // end of main method } National Taiwan University Department of Computer Science and Information Engineering 53 Your Turn Basic Practice 請製作一個程式,輸入身高與體重,並告知是否合乎身材比例,例如, 170公分 65公斤重, 輸入: java SlimBody2 170 65 輸出:下列四者之一 體重 kg / (身高 m)2 ? 過輕 = 體重 kg / (身高 m)2 24 ? 標準體重 24 = 體重 kg / (身高 m)2 27 ? 過重 BMI 體重 kg / (身高 m)2 27 ? 肥胖 (注意:身高在公式中的單位為公尺 ) National Taiwan University Department of Computer Science and Information Engineering 54 Your Turn Hint: public class SlimBody2 { public static void main(String[] args) { … // 肥胖 (You are too fat!!)。 // 過重 (You are over weight.)。 // 標準體重 (Good Shape! Keep going!)。 // 過輕 (Poor baby! Don39。t you eat something?)。 } } National Taiwan University Department of Computer Science and Information Engineering 55 Your Turn Advanced Practice 請寫出一個程式讀入三個整數(shù),找出最大和最小的數(shù)。 例如, java Compare 25 23 67 輸出:最大 67。 最小 23 例如, java Compare 54 43 21 輸出:最大 54。 最小 21 National Taiwan University Department of Computer Science and Information Engineering 56 Your Turn Hint: 慢的版本 if(ab amp。amp。 bc) (“Max= ”+a+” Min=”+c) else if(ab amp。amp。 bc) … 快的版本 int max, min。 if(ab){max = a, min = b。} …
點擊復制文檔內容
法律信息相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1