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.
34 lines
302 B
34 lines
302 B
![]()
4 years ago
|
package solutions
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
)
|
||
|
|
||
|
func ForEach(f func(int), arr []int) {
|
||
|
|
||
|
for _, el := range arr {
|
||
|
f(el)
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
func Add0(nbr int) {
|
||
|
|
||
|
fmt.Println(nbr)
|
||
|
}
|
||
|
|
||
|
func Add1(nbr int) {
|
||
|
|
||
|
fmt.Println(nbr + 1)
|
||
|
}
|
||
|
|
||
|
func Add2(nbr int) {
|
||
|
|
||
|
fmt.Println(nbr + 2)
|
||
|
}
|
||
|
|
||
|
func Add3(nbr int) {
|
||
|
|
||
|
fmt.Println(nbr + 3)
|
||
|
}
|