fork download
  1. object Main extends App {
  2. import scala.annotation.tailrec
  3. @tailrec
  4. def gcd(a: Int, b: Int): Int =
  5. if (b == 0) a
  6. else gcd(b, a % b)
  7.  
  8. println(gcd(3, 9))
  9. }
Success #stdin #stdout 0.34s 382080KB
stdin
Standard input is empty
stdout
3