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.
30 lines
403 B
30 lines
403 B
package main |
|
|
|
import ( |
|
"os" |
|
|
|
"github.com/01-edu/z01" |
|
) |
|
|
|
func toLowerCase(a rune) rune { |
|
if a >= 'A' && a <= 'Z' { |
|
dif := 'a' - 'A' |
|
return a + dif |
|
} |
|
return a |
|
} |
|
|
|
func main() { |
|
if len(os.Args) > 1 { |
|
arg := []rune(os.Args[1]) |
|
for _, c := range arg { |
|
z01.PrintRune(c) |
|
rep := int(toLowerCase(c) - 'a') |
|
for i := 0; i < rep; i++ { |
|
z01.PrintRune(c) |
|
} |
|
} |
|
} |
|
|
|
z01.PrintRune('\n') |
|
}
|
|
|