Created
January 23, 2013 12:08
-
-
Save zerosum/4604885 to your computer and use it in GitHub Desktop.
Project Euler: Problem 15
This file contains hidden or 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
| package euler.zerosum | |
| object Euler0015 { | |
| def main(args: Array[String]) { | |
| val width = args(0).toInt | |
| val height = args(1).toInt | |
| val numer = width + 1 to width + height | |
| val denom = 1 to height | |
| println( | |
| numer.map(scala.math.BigInt(_)).product / denom.map(scala.math.BigInt(_)).product | |
| ) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment