functions

作者: BANGBANGNT | 来源:发表于2017-12-07 19:06 被阅读0次
package main

import "fmt"

func plus(a int, b int) int {
    return a + b
}

func plusPlus(a, b, c int) int {
    return a + b + c
}

func main() {
    res := plus(1, 2)
    fmt.Println("1+2 =", res)

    res = plusPlus(1, 2, 3)
    fmt.Println("1+2+3 =", res)
}

相关文章

网友评论

      本文标题:functions

      本文链接:https://www.haomeiwen.com/subject/lpyjixtx.html