This commit is contained in:
2021-12-03 22:26:30 +08:00
parent 0e0e9b30c4
commit e4cf88c175
3 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
//: [Previous](@previous)
//: ##
/*:
:
func (: , ...) -> {}
- letlet
*/
func sum(v1: Int, v2: Int) -> Int {
return v1 + v2
}
//: ###
func sayHello() -> Void {}
func sayHello1() -> () {}
func sayHello2() {}
//: ###
//
func sum0(v1: Int, v2: Int) -> Int {
v1 + v2
}
//: ###
func caculate(v1: Int, v2: Int) -> (sum: Int, difference: Int, average: Int) {
let sum = v1 + v2
return (sum, v1 - v2, sum >> 1)
}
let result = caculate(v1:20, v2:10)
result.sum
//: ###
///
///
///
func addNumber(v1: Int, v2: Int) -> Int {
v1 + v2
}
addNumer(v1: 20, v2: 30);
//: ###
//: [Next](@next)