mirror of https://github.com/01-edu/public.git
1 changed files with 24 additions and 0 deletions
@ -0,0 +1,24 @@
|
||||
## 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$ |
||||
``` |
Loading…
Reference in new issue