iT邦幫忙

0

[Day 20] 年齡輸入檢查

  • 分享至 

  • xImage
  •  

1.題目

請撰寫一個程式,讓使用者輸入年齡。

  • 如果輸入不是整數(例如英文或符號),要提示「請輸入數字!」
  • 如果年齡小於 0 或大於 120,要提示「年齡不合理!」
  • 否則,輸出「你今年 X 歲」

2.程式

https://ithelp.ithome.com.tw/upload/images/20251029/20179309MgqTD8pfei.png


圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言