#!/usr/bin/env swift; import Foundation import Utils func factorial(_ x:Int) -> Int64 { if x <= 1 { return 1 } return x * factorial(x - 1) } // Begin Main for x:Int in 1..<10 { print(Utils.format("{0:d}! = {1:d}", x, factorial(x))) } exit(EXIT_SUCCESS)