changeset 272 | da3d30ae67ec |
parent 268 | e43f7e92ba26 |
child 273 | b19227660752 |
271:48e12e7aee6e | 272:da3d30ae67ec |
---|---|
256 |
256 |
257 //gcd - Euclid's algorithm |
257 //gcd - Euclid's algorithm |
258 |
258 |
259 def gcd(a: Int, b: Int) : Int = { |
259 def gcd(a: Int, b: Int) : Int = { |
260 if (b == 0) a |
260 if (b == 0) a |
261 else { |
261 else gcd(b, a % b) |
262 val foo = 42 |
|
263 gcd(b, a % b) |
|
264 } |
|
265 } |
262 } |
266 |
263 |
267 gcd(48, 18) |
264 gcd(48, 18) |
268 |
265 |
269 |
266 |