From 88385e3c5f39901d95f6bacfe3445dcd57e546e6 Mon Sep 17 00:00:00 2001 From: Augusto Date: Wed, 24 Apr 2019 11:10:03 +0100 Subject: [PATCH] greatest common divisor exam exercise readme --- subjects/gcd.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 subjects/gcd.md diff --git a/subjects/gcd.md b/subjects/gcd.md new file mode 100644 index 000000000..3cf126ae9 --- /dev/null +++ b/subjects/gcd.md @@ -0,0 +1,27 @@ +# gcd +## Instructions + +Write a program that takes two strings representing two strictly positive +integers that fit in an int. + +Display their highest common denominator followed by a newline (It's always a +strictly positive integer). + +If the number of parameters is not 2, display a newline. + +## Expected output + +```console +student@ubuntu:~/student/gcd$ go build +student@ubuntu:~/student/gcd$ ./gcd 42 10 | cat -e +2$ +student@ubuntu:~/student/gcd$ ./gcd 42 12 | cat -e +6$ +student@ubuntu:~/student/gcd$ ./gcd 14 77 | cat -e +7$ +student@ubuntu:~/student/gcd$ ./gcd 17 3 | cat -e +1$ +student@ubuntu:~/student/gcd$ ./gcd | cat -e +$ +student@ubuntu:~/student/gcd$ +```