//: Playground - noun: a place where people can play import UIKit //*******************嵌套函数***************************** func getMathFunc(type:String) -> ((Int) -> Int) { func squre(num:Int) -> Int{ return num * num } func cube(num:Int) -> Int…
//: Playground - noun: a place where people can play import UIKit /////////////////////////////////////////// // //func sorted(isOrderedBefore:(T, T)->Bool) -> [T]{ // //} let animals = ["fish", "cat", "chicken", "…