mirror of https://github.com/01-edu/public.git
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.
25 lines
568 B
25 lines
568 B
5 years ago
|
## compareprog
|
||
|
|
||
|
### Instructions
|
||
|
|
||
|
Write a program that behaves like the `Compare` function.
|
||
|
|
||
|
This program prints a number comparing two strings lexicographically.
|
||
|
|
||
|
### Expected output :
|
||
|
|
||
|
```console
|
||
|
student@ubuntu:~/compareprog$ go build
|
||
|
student@ubuntu:~/compareprog$ ./compareprog a b | cat -e
|
||
|
-1$
|
||
|
student@ubuntu:~/compareprog$ ./compareprog a a | cat -e
|
||
|
0$
|
||
|
student@ubuntu:~/compareprog$ ./compareprog b a | cat -e
|
||
|
1$
|
||
|
student@ubuntu:~/compareprog$ ./compareprog b a d | cat -e
|
||
|
$
|
||
|
student@ubuntu:~/compareprog$ ./compareprog | cat -e
|
||
|
$
|
||
|
student@ubuntu:~/compareprog$
|
||
|
```
|