import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
func sum(_ n:Int) -> Int{
var a = 0
for i in 0 ... n {
a += i
}
return a
}
func recursion (_ number :Int) -> Int {
print("---\(number)---")
if(number == 1){
return 1
} else {
print("(\(number)) + recursion(\(number-1))")
return number + recursion(number-1)
}
}
print(recursion(10))
}
}