|
|
@ -1,10 +1,11 @@ |
|
|
|
## swap-args |
|
|
|
## swap-args |
|
|
|
|
|
|
|
|
|
|
|
### Instructions |
|
|
|
### Instructions |
|
|
|
Write a program that takes two arguments and swaps them |
|
|
|
|
|
|
|
- If the arguments are not 2 print (`'\n'`). |
|
|
|
Write a program that takes two arguments and swaps them. |
|
|
|
- Separate the arguments with (`' '`) |
|
|
|
- If the number of arguments is different from 2, print (`'\n'`). |
|
|
|
- Print (`'\n'`) at the end of the output. |
|
|
|
- The arguments must be separated by a withe space. |
|
|
|
|
|
|
|
- Print (`'\n'`) at the end of the program. |
|
|
|
|
|
|
|
|
|
|
|
### Usage |
|
|
|
### Usage |
|
|
|
|
|
|
|
|
|
|
@ -14,5 +15,5 @@ $ |
|
|
|
$ go run . 1 2 | cat -e |
|
|
|
$ go run . 1 2 | cat -e |
|
|
|
2 1$ |
|
|
|
2 1$ |
|
|
|
$ go run . "World" "Hello" | cat -e |
|
|
|
$ go run . "World" "Hello" | cat -e |
|
|
|
Hello! World$ |
|
|
|
Hello World$ |
|
|
|
``` |
|
|
|
``` |
|
|
|