```python= """111_summer Python Midterm Problem1 # 輸入數字 """ def input_equation(): valid = False while not valid: equation = input("請輸入方程式:") equation = equation.replace(" ", "") # 移除空白 # 檢查方程式是否合法 match = re.match(r"\((\d*)x([\+\-]\d*)y\)\^(\d*)", equation) if match: valid = True else: print("") return match.groups() # 回傳使用者輸入的數字 # Problem 1 solution # problem solution write here # you need use input_number funtion in your solution def main(): a, b, c = input_equation() # 構建方程式字串 equation = f"{int(a)**int(c)}*x^{c}+{2*int(a)*int(b)}*x*y+{int(b)**int(c)}*y^{c}" print("展開式:", equation) main() ``` 執行結果: ![](https://hackmd.io/_uploads/r1_2eWTF2.png) 部分測試成功! else I tried my best.. 詢問ChatGPT過程: https://chat.openai.com/share/c1772c10-517a-4930-ba37-90ee4517ec30