Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- object Test {
- def GCD(a: Int, b: Int): Int = {
- a%b match {
- case 0 => b
- case _ => GCD(b, a%b)
- } // match
- } // def
- def main(args: Array[String]) {
- println(GCD(16,28)) // should print 4
- } // main
- } // object
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement