for c in 1...40 {
    for b in 1..<c {
        for a in 1..<b {
            if a * a + b * b == c * c {
                print("\(a), \(b), \(c)")
            }
        }
    }
}

for c in 1...50 {
    for b in 1..<c {
        for a in 1..<b {
            if a * a + b * b == c * c {
                println("\(a), \(b), \(c)")
            }
        }
    }
}

--- 
+++ 
@@ -1,8 +1,8 @@
-for c in 1...50 {
+for c in 1...40 {
     for b in 1..<c {
         for a in 1..<b {
             if a * a + b * b == c * c {
-                println("\(a), \(b), \(c)")
+                print("\(a), \(b), \(c)")
             }
         }
     }
Upgrade example to Swift 2.1
