開発環境
- OS X Mavericks - Apple(OS)
- Xcode 6.0 Beta
- Swift (プログラミング言語)
Practical Programming: An Introduction to Computer Science Using Python 3 (Pragmatic Programmers) (Paul Gries (著)、Jennifer Campbell (著)、Jason Montojo (著)、Lynn Beighley (編集)、Pragmatic Bookshelf)のChapter 9(Repeating Code Using Loops)、9.10(Exercises) 2.をSwiftで考えてみる。
9.10(Exercises) 2.
コード(Xcode)
main.swift
//
// main.swift
// sample2
//
// Created by kamimura on 9/3/14.
// Copyright (c) 2014 kamimura. All rights reserved.
//
import Foundation
let half_lives:[Double] = [87.74, 24110.0, 6537.0, 14.4, 376000.0]
for live:Double in half_lives {
print("\(live) ")
}
println()
入出力結果(Console Output)
87.74 24110.0 6537.0 14.4 376000.0 Program ended with exit code: 0
0 コメント:
コメントを投稿