diff --git a/subjects/compareprog.en.md b/subjects/compareprog.en.md index dbfbf2f8e..0d648f309 100644 --- a/subjects/compareprog.en.md +++ b/subjects/compareprog.en.md @@ -4,9 +4,9 @@ Write a program that behaves like the `Compare` function. -This program prints a number comparing two strings lexicographically. +This program prints a number after comparing two `strings` lexicographically. -### Expected output : +### Usage : ```console student@ubuntu:~/compareprog$ go build diff --git a/subjects/compareprog.fr.md b/subjects/compareprog.fr.md new file mode 100644 index 000000000..ebdaf7345 --- /dev/null +++ b/subjects/compareprog.fr.md @@ -0,0 +1,24 @@ +## compareprog + +### Instructions + +Écrire un programme qui se comporte comme la fonction `Compare`. + +Ce programme affiche un nombre après avoir comparé deux `strings` lexicalement. + +### Utilisation : + +```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$ +```