15 lines
171 B
Plaintext
15 lines
171 B
Plaintext
import log
|
|
|
|
main() {
|
|
log.number(gcd(1071, 462))
|
|
}
|
|
|
|
gcd(a Int, b Int) -> Int {
|
|
loop {
|
|
switch {
|
|
a == b { return a }
|
|
a > b { a -= b }
|
|
_ { b -= a }
|
|
}
|
|
}
|
|
} |