x = float(input("清输入 x: ")) if (x < 1): print((x+1)**2) # x < 1 else: print(4-(x-1)**0.5) # x >= 1