//: Playground - noun: a place where people can playimport UIKitfunc add(a:Int, b:Int) -> Int{ return a + b}// 其中, (Int, Int) -> Int 就是显式的声明函数类型let...
分类:
编程语言 时间:
2015-12-17 15:58:38
阅读次数:
154
函数可以作为一种类型使用,作为类型与其它数据类型没有区别:有如下3个函数的定义:(1)funcrectangleArea(width:Double,height:Double)->Double{letarea=width*heightreturnarea}(2)functriangleArea(bottom:Double,height:Double)->Double{letarea=0.5*bottom*heightre..
分类:
编程语言 时间:
2015-03-14 20:13:15
阅读次数:
200