美文网首页
无标题文章

无标题文章

作者: 祺了个祺 | 来源:发表于2016-11-18 17:24 被阅读2次

swift 语法

1.inout()

希望传入参数通过函数改变

func swapTwoInts( a:Int, b:Int){

var a = a

var b = b

let t = a

a = b

b = t

}

var x = 0,y = 100

print("x = \(x) ;y = \(y)")

swapTwoInts(a: x, b: y)

print("x = \(x) ;y = \(y)")    //(x=0,y=100)

func swapTwoInts2( a:inout Int, b:inout Int){

let t = a

a = b

b = t

}

var f = 0,g = 100

print("f = \(f) ;g = \(g)")

swapTwoInts2(a: &f, b: &g)

print("f = \(f) ;g = \(g)")   //(f=100,g=0)

2.画驯鹿流程图

相关文章

  • 无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章 无标题文章无标题文章无标题文章无...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • fasfsdfdf

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标...

  • 无标题文章

    无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章无标题文章

  • 无标题文章

    无标题文章 无标题文章 无标题文章无标题文章 无标题文章 无标题文章

网友评论

      本文标题:无标题文章

      本文链接:https://www.haomeiwen.com/subject/rohspttx.html