mirror of https://github.com/01-edu/public.git
27 changed files with 141 additions and 103 deletions
@ -1,9 +1,13 @@ |
|||||||
package main |
package main |
||||||
|
|
||||||
|
import ( |
||||||
|
"piscine" |
||||||
|
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
Chunk([]int{}, 10) |
piscine.Chunk([]int{}, 10) |
||||||
Chunk([]int{0, 1, 2, 3, 4, 5, 6, 7}, 0) |
piscine.Chunk([]int{0, 1, 2, 3, 4, 5, 6, 7}, 0) |
||||||
Chunk([]int{0, 1, 2, 3, 4, 5, 6, 7}, 3) |
piscine.Chunk([]int{0, 1, 2, 3, 4, 5, 6, 7}, 3) |
||||||
Chunk([]int{0, 1, 2, 3, 4, 5, 6, 7}, 5) |
piscine.Chunk([]int{0, 1, 2, 3, 4, 5, 6, 7}, 5) |
||||||
Chunk([]int{0, 1, 2, 3, 4, 5, 6, 7}, 4) |
piscine.Chunk([]int{0, 1, 2, 3, 4, 5, 6, 7}, 4) |
||||||
} |
} |
||||||
|
@ -1,8 +1,11 @@ |
|||||||
package main |
package main |
||||||
|
|
||||||
import "fmt" |
import ( |
||||||
|
"fmt" |
||||||
|
"piscine" |
||||||
|
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
fmt.Println(FindPrevPrime(5)) |
fmt.Println(piscine.FindPrevPrime(5)) |
||||||
fmt.Println(FindPrevPrime(4)) |
fmt.Println(piscine.FindPrevPrime(4)) |
||||||
} |
} |
||||||
|
@ -1,17 +1,20 @@ |
|||||||
package main |
package main |
||||||
|
|
||||||
import "fmt" |
import ( |
||||||
|
"fmt" |
||||||
|
"piscine" |
||||||
|
) |
||||||
|
|
||||||
func main() { |
func main() { |
||||||
table := []int{1, 2, 3} |
table := []int{1, 2, 3} |
||||||
ac := 93 |
ac := 93 |
||||||
FoldInt(Add, table, ac) |
piscine.FoldInt(Add, table, ac) |
||||||
FoldInt(Mul, table, ac) |
piscine.FoldInt(Mul, table, ac) |
||||||
FoldInt(Sub, table, ac) |
piscine.FoldInt(Sub, table, ac) |
||||||
fmt.Println() |
fmt.Println() |
||||||
|
|
||||||
table = []int{0} |
table = []int{0} |
||||||
FoldInt(Add, table, ac) |
piscine.FoldInt(Add, table, ac) |
||||||
FoldInt(Mul, table, ac) |
piscine.FoldInt(Mul, table, ac) |
||||||
FoldInt(Sub, table, ac) |
piscine.FoldInt(Sub, table, ac) |
||||||
} |
} |
||||||
|
Loading…
Reference in new issue