給定一個名為Exercise的struct,如下列所示:
Exercise
- int x
- int y
- char op
再給定主要執行程式main.c (題號.c)、以及Header檔function.h (題號.h);請試著完成Header檔中未實現的函式:SetValue()、GetAnswer()
Methods:
- void SetValue(Exercise* ex, double _x, double _y, char _op) - Should set ex's x value to _x, ex's y value to _y, ex's op value to _op
- void GetAnswer(Exercise ex) - Should return the answer of the math exercise ex
function.c
輸入符合以下格式
op x1 y1
Note:
輸出符合以下格式:
x op y = ans
Note: