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.
33 lines
444 B
33 lines
444 B
5 years ago
|
package main
|
||
|
|
||
|
import (
|
||
5 years ago
|
"fmt"
|
||
5 years ago
|
"os"
|
||
|
"strconv"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
5 years ago
|
args := os.Args[1:]
|
||
|
if len(args) == 0 {
|
||
|
return
|
||
|
}
|
||
|
var upper bool
|
||
|
if args[0] == "--upper" {
|
||
|
upper = true
|
||
|
args = args[1:]
|
||
|
}
|
||
|
for _, arg := range args {
|
||
|
if nb, err := strconv.Atoi(arg); err != nil || nb < 1 || nb > 26 {
|
||
|
fmt.Print(" ")
|
||
5 years ago
|
} else {
|
||
5 years ago
|
if upper {
|
||
|
nb += 'A' - 1
|
||
|
} else {
|
||
|
nb += 'a' - 1
|
||
5 years ago
|
}
|
||
5 years ago
|
fmt.Printf("%c", rune(nb))
|
||
5 years ago
|
}
|
||
|
}
|
||
5 years ago
|
fmt.Println()
|
||
5 years ago
|
}
|