forked from root/public
Compare commits
7 Commits
master
...
1136-samec
Author | SHA1 | Date |
---|---|---|
zainabdnaya | 7fe5f0851c | 2 years ago |
zainabdnaya | 9ec6a23ba8 | 2 years ago |
zainabdnaya | ca19aec9d7 | 2 years ago |
zainabdnaya | 65e87084e1 | 2 years ago |
zainabdnaya | ffa9b9b139 | 2 years ago |
zainabdnaya | 9c98dc0d8c | 2 years ago |
zainabdnaya | 3f98031242 | 2 years ago |
1 changed files with 27 additions and 0 deletions
@ -0,0 +1,27 @@
|
||||
## Same-Case |
||||
|
||||
### Instructions |
||||
|
||||
Write a program that takes 2 characters as arguments and does the following: |
||||
- If either of the characters is not a letter, return -1. |
||||
- If both characters are the same case, return 1. |
||||
- If both characters are letters but not the same case, return 0. |
||||
- A newline character should follow all outputs. |
||||
- If the argument is more than one character or if it's empty, return a newline. |
||||
|
||||
### Usage |
||||
|
||||
```console |
||||
$ go run . | cat -e |
||||
$ |
||||
$ go run . "p" "w"| cat -e |
||||
1$ |
||||
$ go run . "p" "Q" | cat -e |
||||
0$ |
||||
$ go run . "p" "4" | cat -e |
||||
-1$ |
||||
$ go run . "P" "Q" "W" | cat -e |
||||
$ |
||||
$ go run . A b | cat -e |
||||
0$ |
||||
``` |
Loading…
Reference in new issue