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.
22 lines
306 B
22 lines
306 B
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"os"
|
||
5 years ago
|
"unicode"
|
||
5 years ago
|
)
|
||
|
|
||
|
func main() {
|
||
5 years ago
|
for _, arg := range os.Args[1:] {
|
||
|
arg := []rune(arg)
|
||
|
for j, r := range arg {
|
||
|
if j+1 == len(arg) || arg[j+1] == ' ' {
|
||
|
arg[j] = unicode.ToUpper(r)
|
||
5 years ago
|
} else {
|
||
5 years ago
|
arg[j] = unicode.ToLower(r)
|
||
5 years ago
|
}
|
||
|
}
|
||
|
fmt.Println(string(arg))
|
||
|
}
|
||
|
}
|