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.

37 lines
822 B

2 years ago
## argsort
2 years ago
2 years ago
### Instructions
2 years ago
2 years ago
Write a program that checks if an argument is sorted or not, the comparison should be by index of ascii and all printable characters will be used.
2 years ago
- Your program should return `T` followed by a newline `\n` if the argument is sorted.
- Your program should return `F` followed by a newline `\n` if the argument is not sorted.
- If the number of arguments is different from 2, do nothing.
2 years ago
### Usage
2 years ago
And it's output should be:
2 years ago
```console
2 years ago
$ go run . | cat -e
2 years ago
$ go run . a | cat -e
2 years ago
T$
2 years ago
$ go run . "zA1" | cat -e
F$
2 years ago
$ go run . " 5ABc" | cat -e
T$
$ go run . " s" | cat -e
T$
$ go run . "s " | cat -e
2 years ago
F$
$ go run . "a b c" | cat -e
F$
2 years ago
$ go run . " abc" | cat -e
T$
2 years ago
$ go run . "2?@@^_\`abc" | cat -e
2 years ago
T$
2 years ago
$ go run . "Hello World" | cat -e
2 years ago
F$
2 years ago
$ go run . "01Talent" "student" | cat -e
2 years ago
```