Skip to content

Instantly share code, notes, and snippets.

@necoco
Created December 8, 2012 06:39
Show Gist options
  • Save necoco/4238943 to your computer and use it in GitHub Desktop.
Save necoco/4238943 to your computer and use it in GitHub Desktop.
宿題
fun main(args: Array<String>){
val a = args[0].toInt()
val b = args[1].toInt()
println(divisor(a, b))
}
fun divisor(val a: Int,val b: Int): Int{
val n = a % b
if(n != 0){
return divisor(b, n)
}else{
return b
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment