2014年9月1日月曜日

開発環境

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) 1.をSwiftで考えてみる。

9.10(Exercises) 1.

コード(Xcode)

main.swift

//
//  main.swift
//  sample1
//
//  Created by kamimura on 9/1/14.
//  Copyright (c) 2014 kamimura. All rights reserved.
//

import Foundation

let celegans_phenotypes:[String] = ["Emb", "Him", "Unc", "Lon", "Dpy", "Sma"]

for phenotype in celegans_phenotypes {
    println(phenotype)
}

入出力結果(Console Output)

Emb
Him
Unc
Lon
Dpy
Sma
Program ended with exit code: 0

0 コメント:

コメントを投稿