Created
March 15, 2012 13:43
-
-
Save takungsk/2044260 to your computer and use it in GitHub Desktop.
階乗計算
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 階乗計算 | |
def fact(n: Int): Int = { | |
n match { | |
case 0 => 1 | |
case _ => n * (n - 1) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment