//TODO:打印
func prin(){
print("hello work")
print("sub = \(sub)")
}
//TODO:声明变量、常量
func verLet(){
//let 常量修饰符
let a = 10 //整型
let b = 11.2 //浮点
let c = true //布尔
let d = String(a) + "test" //字符串
var e = ["d","aa"]
var dic = ["a":"1","b":"e"]
dic["d"] = "d"
//ver 变量修饰符
var f = 10
f = 11
var g = e
g[0] = "sd"
}
Swift_声明变量var、常量let
最新推荐文章于 2023-05-02 12:19:28 发布