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
963 B
27 lines
963 B
![]()
4 years ago
|
## revwstr
|
||
5 years ago
|
|
||
|
### Instructions
|
||
|
|
||
![]()
5 years ago
|
Write a program that takes a `string` as a parameter, and prints its words in reverse.
|
||
5 years ago
|
|
||
5 years ago
|
- A word is a sequence of **alphanumerical** characters.
|
||
5 years ago
|
|
||
![]()
4 years ago
|
- If the number of arguments is different from 1, the program will display nothing.
|
||
5 years ago
|
|
||
![]()
4 years ago
|
- In the parameters that are going to be tested, there will not be any extra spaces. (meaning that there will not be additional spaces at the beginning or at the end of the `string` and that words will always be separated by exactly one space).
|
||
5 years ago
|
|
||
![]()
5 years ago
|
### Usage
|
||
5 years ago
|
|
||
|
```console
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ go build
|
||
|
student@ubuntu:~/[[ROOT]]/test$ ./test "the time of contempt precedes that of indifference"
|
||
5 years ago
|
indifference of that precedes contempt of time the
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ ./test "abcdefghijklm"
|
||
5 years ago
|
abcdefghijklm
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ ./test "he stared at the mountain"
|
||
5 years ago
|
mountain the at stared he
|
||
5 years ago
|
student@ubuntu:~/[[ROOT]]/test$ ./test "" | cat-e
|
||
![]()
5 years ago
|
$
|
||
![]()
4 years ago
|
student@ubuntu:~/[[ROOT]]/test$
|
||
5 years ago
|
```
|