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)")
            }
        }
    }
}

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)")
            }
        }
    }
}

Upgrade example to Swift 2.1
Upgrade example to Swift 2.1
