###### tags: `實習額外加分題` 第八次實習課額外練習題 - call-by reference 練習 === ## Description 請設計一個 function 名為 add 用來實作累加的功能,其有兩個參數,第一個參數為 int 的 call-by reference 變數名為 sum,第二個參數為 int 的 call-by reference 變數名為 a。 今天會讓使用者輸入一個數,代表從 1 累加到這個數。 請在 main 內使用 for 來完成此題。 請根據 call-by reference 的理論審慎思考 add function 的 function type,什麼樣形態的 add 會讓你的程式碼看起來更簡潔。 ## Sample input and output 1 ``` 10 55 ``` ## Sample input and output 2 ``` 100 5050 ```