2018-10-11元组

vara:UInt=10

letmaxValue =Int32.max

letminValue =UInt8.min

varb:Int=-10

var c:Double = 1.5

letd =Double(a) +Double(b) +c

//Bool : true false

var e = true

e = false

//if(1){}

//if(0){}else{}

//元组

let f = (1,"zhan",20,"171040142","移动互联","male")

letg = (id:1,name:"zhan",age:20,no:"171040142",zy:"移动互联",sex:"male")

//下标的方式方向

print(f.3)

//别名的方式访问

print(g.sex)

//应用方式

var dic = ["id":"1","name":"zhan"]

for(key,value)indic

{

    print("\(key)--\(value)")


}

//{"key1":"value1","key2":"value2",....}

//

//for(int i = 0;i

//{

//}

varnum1 =10

varnum2 =20

//比较运算符返回是Bool类型的值

varresult =num1==num2

varcon1 =true

varcon2 =false

//与或非

print(!con1)

print(!con2)

print(con1&&con2)

print(con1||con2)

你可能感兴趣的:(2018-10-11元组)