1.函数的定义
import UIKit
/**
函数名:test1
参数类型:无
返回值类型:无
*/
func test1(){
//函数体
}
/**
函数名:test2
参数类型:无
返回值类型:Int
*/
func test2() -> Int{
//函数体
return 0
}
/**
函数名:test3。计算两个数之和
参数类型:Int型*2
返回值类型:Int
*/
func test3(a:Int,b:Int) -> Int{
return a+b
}