Advertisement
Guest User

Untitled

a guest
May 23rd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. def f(x, y, z):
  2.     if x >= y:
  3.         if y >= z:     # x y z
  4.             return x**2 + y**2
  5.         else:          # x z y
  6.             return x**2 + z**2
  7.     else:
  8.         if x >= z:     # y x z
  9.             return y**2 + x**2
  10.         else:          # y z x
  11.             return y**2 + z**2
  12. x=int(input("請輸入您的第一個數字"))
  13. y=int(input("請輸入您的第二個數字"))
  14. z=int(input("請輸入您的第三個數字"))
  15. print("{}**2+{}**2=",f(x,y,z))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement