swift 第三天 函数

/*************************************/

func sayHello(name: String,age: Int){

    print("your name is \(name),age is \(age)")

    

      }

sayHello("cai",age: 18)

/*************************************/

func sayHello()->Int{

    

    return 16

   }

 print (sayHello())

/*************************************/

func sayHello() {

    

    print("abc")

   }

sayHello()

/*************************************/

func sayHello(personName: String) -> String {

    let greeting = "Hello, " + personName + "!"

    return greeting

}

print(sayHello("caibin"))

posted @ 2015-12-18 13:48  egai  阅读(112)  评论(0编辑  收藏  举报