mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
510 B
39 lines
510 B
5 years ago
|
## lcm
|
||
|
|
||
|
### Instructions
|
||
|
|
||
|
Write a function, `lcm`, that returns least common multiple.
|
||
|
|
||
5 years ago
|
It will be tested with positive `int` values and `0`.
|
||
5 years ago
|
|
||
|
### Expected function
|
||
|
|
||
|
```go
|
||
|
func Lcm(first, second int) int {
|
||
|
|
||
|
}
|
||
|
```
|
||
|
|
||
|
### Usage
|
||
|
|
||
|
Here is a possible program to test your function :
|
||
|
|
||
|
```go
|
||
|
package main
|
||
|
|
||
|
func main() {
|
||
5 years ago
|
fmt.Println(Lcm(2, 7))
|
||
|
fmt.Println(Lcm(0, 4))
|
||
5 years ago
|
}
|
||
|
```
|
||
|
|
||
|
### Output
|
||
|
|
||
|
```console
|
||
|
student@ubuntu:~/[[ROOT]]/test$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/test$ ./test
|
||
|
14
|
||
5 years ago
|
0
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$
|
||
|
```
|