Swift

//: Playground - noun: a place where people can play

import UIKit

// 外部参数的作用是为了让程序员调用代码的时候能清晰的看出所传参数代表的意思
// 内部参数指的就是定义函数的时候所设定需要传入的参数

func sayHello(nickName nickName:String, greeting:String) -> String
{
    let result = greeting + "," + nickName + "!"
    return result
}

print(sayHello(nickName:"Bobo", greeting:"Good morning"))

  

原文地址:https://www.cnblogs.com/Rinpe/p/5053641.html