From 7e83cc24c073bc0256b919572025fa96fbc7ee6f Mon Sep 17 00:00:00 2001 From: lee Date: Wed, 2 Oct 2019 12:46:32 +0100 Subject: [PATCH] compareprog readme for the exams --- subjects/compareprog.en.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 subjects/compareprog.en.md diff --git a/subjects/compareprog.en.md b/subjects/compareprog.en.md new file mode 100644 index 000000000..dbfbf2f8e --- /dev/null +++ b/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$ +```