x ← 輸入整數 y ← 輸入整數 if x > y: print x else: print y
以函式實作如下:
max(x y): if x > y: return x else: return y x ← 輸入整數 y ← 輸入整數 print max(x, y)