Browse Source

compareprog readme for the exams

pull/292/head
lee 5 years ago committed by Christopher Fremond
parent
commit
7e83cc24c0
  1. 24
      subjects/compareprog.en.md

24
subjects/compareprog.en.md

@ -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…
Cancel
Save