使用者工具

網站工具


c:homework:hw3

目錄表

國立屏東大學 資訊工程學系

作業1


turnin code cpp.hw1

第1題

  1. 設計一個可以轉換西元年為民國年的程式
  2. 檔名要求為AD2ROC.cpp
  3. 程式執行結果參考:

[9:19 user@ws hw1] ./a.out
Please input year in AD: 2013
2013 AD is ROC 102.
[9:19 user@ws hw1] ./a.out
Please input year in AD: 1911
1911 AD is ROC 0.
[9:19 user@ws hw1] ./a.out
Please input year in AD: 2050
2050 AD is ROC 139.
[9:19 user@ws hw1]


第2題

  1. 設計一個C++語言程式,讓使用者輸入矩形的長與寬(以cm為單位),計算並輸出該矩形的面積。
  2. 檔名要求為area.cpp
  3. 程式執行結果參考:

[9:19 user@ws hw1] ./a.out
Please input the width: 5
Please input the height: 6 
The area is 5 x 6 = 30. 
[9:19 user@ws hw1] ./a.out
Please input the width: 10
Please input the height: 12 
The area is 10 x 12 = 120.
[9:19 user@ws hw1]

c/homework/hw3.txt · 上一次變更: 2021/03/27 15:37 由 junwu

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki