Skip to content

Instantly share code, notes, and snippets.

@vsalvati
Created October 24, 2012 18:24
Show Gist options
  • Select an option

  • Save vsalvati/3947871 to your computer and use it in GitHub Desktop.

Select an option

Save vsalvati/3947871 to your computer and use it in GitHub Desktop.
GCD in scala
package main.scala
object GCD
{
def gcd(a: Int,b: Int): Int = {
if(b ==0) a else gcd(b, a%b)
}
def main(args: Array[String]) {
println(gcd(25,15))
}
}
@Sasini2020
Copy link
Copy Markdown

gcd

@yhm138
Copy link
Copy Markdown

yhm138 commented May 9, 2022

the efficience is low?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment