mirror of https://github.com/01-edu/public.git
Xavier Petit
5 years ago
committed by
xpetit
55 changed files with 397 additions and 360 deletions
@ -1,19 +1,19 @@
|
||||
package solutions |
||||
|
||||
//This solution is the comparing file of the staff
|
||||
// This solution is the comparing file of the staff
|
||||
// Because the solution is a function,
|
||||
//
|
||||
//1) here the package is solutions
|
||||
//2) it does not need an empty func main(){}
|
||||
//3) its location is 1 level below the folder of the nauuo_test.go file
|
||||
// 1) here the package is solutions
|
||||
// 2) it does not need an empty func main(){}
|
||||
// 3) its location is 1 level below the folder of the nauuo_test.go file
|
||||
|
||||
func gcd(first, second int) int { |
||||
if (second == 0) { |
||||
return (first) |
||||
if second == 0 { |
||||
return first |
||||
} |
||||
return (gcd(second, first % second)) |
||||
return gcd(second, first%second) |
||||
} |
||||
|
||||
func Lcm(first, second int) int { |
||||
return (first / gcd(second, first % second) * second) |
||||
return first / gcd(second, first%second) * second |
||||
} |
Loading…
Reference in new issue