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
814 B
30 lines
814 B
6 years ago
|
## alphamirror
|
||
6 years ago
|
|
||
6 years ago
|
### Instructions
|
||
6 years ago
|
|
||
6 years ago
|
Write a program called alphamirror that takes a string as argument and displays this string
|
||
|
after replacing each alphabetical character with the opposite alphabetical
|
||
6 years ago
|
character.
|
||
6 years ago
|
|
||
|
The case of the letter stays the same, for example :
|
||
6 years ago
|
|
||
|
'a' becomes 'z', 'Z' becomes 'A'
|
||
|
'd' becomes 'w', 'M' becomes 'N'
|
||
|
|
||
6 years ago
|
The final result will be followed by a newline.
|
||
6 years ago
|
|
||
6 years ago
|
If the number of arguments is not 1, the program will display only a newline.
|
||
6 years ago
|
|
||
6 years ago
|
Example of output :
|
||
6 years ago
|
|
||
|
```console
|
||
|
student@ubuntu:~/student/alphamirror$ go build
|
||
|
student@ubuntu:~/student/alphamirror$ ./alphamirror "abc"
|
||
|
zyx
|
||
|
student@ubuntu:~/student/alphamirror$ ./alphamirror "My horse is Amazing." | cat -e
|
||
|
Nb slihv rh Znzarmt.$
|
||
|
student@ubuntu:~/student/alphamirror$ ./alphamirror | cat -e
|
||
|
$
|
||
6 years ago
|
student@ubuntu:~/student/alphamirror$
|
||
6 years ago
|
```
|