//"inout":值通过参数向外传出
func getSum(_ sum: inout Int,
_ n1: Int, _ n2: Int) {
sum = n1 + n2
}
var sum = 0
getSum(&sum, 5, 3)
//sum is 8
//更常用的是返回元组
func divide(_ a: Int, by b: Int)
-> (quotient: Int, remainder: Int) {
(a / b, a % b)
}
let result = divide(17, by: 5)
//result is (3, 2)
print("sum is \(sum)")
print("quotient is \(result.quotient)")
print("remainder is \(result.remainder)")