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
483 B
34 lines
483 B
package main |
|
|
|
import ( |
|
"unicode" |
|
|
|
student "student" |
|
|
|
"lib" |
|
) |
|
|
|
func alphaCount(s string) (i int) { |
|
for _, r := range s { |
|
if unicode.IsLetter(r) { |
|
i++ |
|
} |
|
} |
|
return i |
|
} |
|
|
|
func main() { |
|
table := []string{ |
|
" ", |
|
"Hello 78 World! 4455 /", |
|
} |
|
for l := 0; l < 7; l++ { |
|
a := lib.RandIntBetween(5, 20) |
|
b := lib.RandASCII() |
|
table = append(table, lib.RandStr(a, b)) |
|
} |
|
|
|
for _, arg := range table { |
|
lib.Challenge("AlphaCount", student.AlphaCount, alphaCount, arg) |
|
} |
|
}
|
|
|