Skip to content

Instantly share code, notes, and snippets.

@doraiso
Created June 9, 2017 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doraiso/51f7cfa112faad3aefc8a5a6a50749f1 to your computer and use it in GitHub Desktop.
Save doraiso/51f7cfa112faad3aefc8a5a6a50749f1 to your computer and use it in GitHub Desktop.
# 台形の面積をコマンドライン入力から求める
a = input("上辺? ")
a = float(a)
b = input("下辺? ")
b = float(b)
h = input("高さ? ")
h = float(h)
daikei = (a + b) * h / 2
print("台形の面積は", daikei, "cm2")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment