Skip to content

Instantly share code, notes, and snippets.

@takungsk
Created March 15, 2012 13:43
Show Gist options
  • Save takungsk/2044260 to your computer and use it in GitHub Desktop.
Save takungsk/2044260 to your computer and use it in GitHub Desktop.
階乗計算
// 階乗計算
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