Skip to content

Instantly share code, notes, and snippets.

@hwiorn
Last active December 16, 2015 11:29
Show Gist options
  • Save hwiorn/5428252 to your computer and use it in GitHub Desktop.
Save hwiorn/5428252 to your computer and use it in GitHub Desktop.
euler 2번 문제
def fib(a: Int, b: Int, sum: Int, _until: Int): Int = {
return if(a < _until) fib(b, a+b, If(a%2==0) sum+a else sum, _until) else sum
}
println(fib(1, 1, 0, 4000000))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment