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.
28 lines
945 B
28 lines
945 B
6 years ago
|
## repeatalpha
|
||
6 years ago
|
|
||
6 years ago
|
### Instructions
|
||
6 years ago
|
|
||
5 years ago
|
Write a program called `repeat_alpha` that takes a `string` and displays it repeating each alphabetical character as many times as its alphabetical index.
|
||
5 years ago
|
|
||
5 years ago
|
The result must be followed by a newline (`'\n'`).
|
||
6 years ago
|
|
||
6 years ago
|
`'a'` becomes `'a'`, `'b'` becomes `'bb'`, `'e'` becomes `'eeeee'`, etc...
|
||
6 years ago
|
|
||
5 years ago
|
If the number of arguments is different from 1, the program displays nothing.
|
||
6 years ago
|
|
||
5 years ago
|
### Usage
|
||
6 years ago
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/repeatalpha$ go build
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha abc | cat -e
|
||
6 years ago
|
abbccc
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha Choumi. | cat -e
|
||
5 years ago
|
CCChhhhhhhhooooooooooooooouuuuuuuuuuuuuuuuuuuuummmmmmmmmmmmmiiiiiiiii.$
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha "abacadaba 01!" | cat -e
|
||
5 years ago
|
abbacccaddddabba 01!$
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/repeatalpha$ ./repeatalpha "" | cat -e
|
||
6 years ago
|
$
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/repeatalpha$
|
||
6 years ago
|
```
|