Swift 变量、常量、数据类型

 1 import Foundation
 2 
 3 print("HelloSwift")
 4 
 5 // 声明变量
 6 var a = 1
 7 var b = 2
 8 a = 10
 9 b = 20
10 
11 // 常量
12 let c = a+b
13 
14 
15 var str = "Hello "
16 var s:String = "World"
17 var i:Int = 100
18 var words:String = "jinpangpang"
19 
20 print(c)
21 print(str)

 

posted @ 2015-11-29 17:48  金胖胖  阅读(176)  评论(0编辑  收藏  举报