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.
29 lines
490 B
29 lines
490 B
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"strconv"
|
||
|
|
||
5 years ago
|
"lib"
|
||
|
"lib/is"
|
||
5 years ago
|
)
|
||
|
|
||
5 years ago
|
func main() {
|
||
5 years ago
|
// adds random numbers
|
||
5 years ago
|
table := lib.MultRandIntBetween(1, 10000)
|
||
5 years ago
|
|
||
5 years ago
|
// fill with all prime numbers between 0 and 100
|
||
5 years ago
|
for i := 0; i < 100; i++ {
|
||
5 years ago
|
if is.Prime(i) {
|
||
5 years ago
|
table = append(table, i)
|
||
5 years ago
|
}
|
||
|
}
|
||
|
|
||
5 years ago
|
for _, i := range table {
|
||
5 years ago
|
lib.ChallengeMain("addprimesum", strconv.Itoa(i))
|
||
5 years ago
|
}
|
||
|
// special cases
|
||
5 years ago
|
lib.ChallengeMain("addprimesum")
|
||
|
lib.ChallengeMain("addprimesum", `""`)
|
||
|
lib.ChallengeMain("addprimesum", "1", "2")
|
||
5 years ago
|
}
|