forked from root/public
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.
27 lines
813 B
27 lines
813 B
![]()
5 years ago
|
## alphamirror
|
||
![]()
5 years ago
|
|
||
![]()
5 years ago
|
### Instructions
|
||
![]()
5 years ago
|
|
||
![]()
5 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 character.
|
||
![]()
5 years ago
|
|
||
|
The case of the letter stays the same, for example :
|
||
![]()
5 years ago
|
|
||
|
'a' becomes 'z', 'Z' becomes 'A'
|
||
|
'd' becomes 'w', 'M' becomes 'N'
|
||
|
|
||
![]()
5 years ago
|
The final result will be followed by a newline (`'\n'`).
|
||
![]()
5 years ago
|
|
||
![]()
4 years ago
|
If the number of arguments is different from 1, the program displays nothing.
|
||
![]()
5 years ago
|
|
||
![]()
5 years ago
|
### Usage
|
||
![]()
5 years ago
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/alphamirror$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/alphamirror$ ./alphamirror "abc"
|
||
![]()
5 years ago
|
zyx
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/alphamirror$ ./alphamirror "My horse is Amazing." | cat -e
|
||
![]()
5 years ago
|
Nb slihv rh Znzarmt.$
|
||
![]()
4 years ago
|
student@ubuntu:~/[[ROOT]]/alphamirror$ ./alphamirror
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/alphamirror$
|
||
![]()
5 years ago
|
```
|