-
case let (x, y) were x == y:查看全部
-
let coordinate = (3, 3) switch coordinate { case (let x, 0): println("the x value is \(x)") }查看全部
-
let coordinate = (1, 1) switch coordinate { case (-2...2, -2...2): println("\(coordinate.0), \(coordinate.1)") }查看全部
-
var coordinate = (1,1) switch coordinate { case (1,1): println("") }查看全部
-
switch score { cas 90..<100: println("Perfect") }查看全部
-
Float Bool String Switch查看全部
-
switch rating { case "a", "A": println("Great!") case "B": println("Just so-so.") default: println("It's Bad.") }查看全部
-
rating查看全部
-
Conditional Statements查看全部
-
二分查找法3查看全部
-
二分查找法2查看全部
-
二分查找法1查看全部
-
Control Flow 控制流 循环结构 Loops for-in 遍历区间 字符串 数组 字典 for i in -99...99 { i*i } for let str = "Hello, iMooc!" for c in str { println(c) } let coursesArray = ["慕课网2048私人定制", "CSS3 3D 特效", "玩儿转Swift"] for item in coursesArray { println(item) } for (index, item) in enumerate(coursesArray) { println("\(index): \(item)") } let coursesDictionary = [76:"慕课网2048私人定制", 77:"CSS3 3D 特效", 127:"玩儿转Swift"] for(index, item) in coursesDictionary { println("\(index):\(item)") } let base = 2 let power = 10 var result = 1 for _ in 1...power { result *= base } result Loop2 for initialization; condition; increments { statements } for i in -100...100 { i*i } for var i = -100; i <= 100; i++ { i*i } while do-while 顺序结构 选择结构查看全部
-
Color查看全部
-
colorStripe查看全部
举报
0/150
提交
取消