Try   HackMD
tags: python-TQC

TQC+ 程式語言Python 109 正五邊形面積計算

  1. 題目說明:
    請開啟PYD109.py檔案,依下列題意進行作答,計算正五邊形之面積,使輸出值符合題意要求。作答完成請另存新檔為PYA109.py再進行評分。

  2. 設計說明:
    請撰寫一程式,讓使用者輸入一個正數s,代表正五邊形之邊長,計算並輸出此正五邊形之面積(Area)。

    Image Not Showing Possible Reasons
    • The image file may be corrupted
    • The server hosting the image is unavailable
    • The image path is incorrect
    • The image format is not supported
    Learn More →

  3. 輸入輸出:
    輸入說明
    正數s

輸出說明
正五邊形面積

Image Not Showing Possible Reasons
  • The image file may be corrupted
  • The server hosting the image is unavailable
  • The image path is incorrect
  • The image format is not supported
Learn More →

import math n = int(input()) a = (5*n**2)/(4*math.tan(math.pi/5)) print("Area = {:.4f}".format(a))