Last semester's version. Not valid until the assignment date.
====== HW 01 - Reducing fractions ======
Write a simple program that:
* reads positive integers representing a fraction from the standard input,
* then [[https://en.wikipedia.org/wiki/Irreducible_fraction | simplifies]] it,
* and finally prints the simplified fraction to the standard output.
Hint: look at the [[https://en.wikipedia.org/wiki/Greatest_common_divisor|GCD]] and find an algorithm to compute it.
Some examples of the program behaviour when called as ./simplify. The first line is the input, and the second is the output.
$ ./simplify
2 / 4
1 / 2
$ ./simplify
765 / 918
5 / 6
$ ./simplify
101 / 100
101 / 100
You can find more testing instances {{ :courses:be5b99cpl:hw:hw1_public.zip |here}}. Files with the suffix ''.in'' contain your input with ''.out'' your desired output.
Your submission must compile without errors with the following compiler flags
''-Wall -Werror -pedantic -std=c99 -O2''
When you have your input in a file, e.g. ''pub00.in'' containing
2 / 4
you can pass it to your program in the bash like
$ cat pub00.in | ./simplify
1 / 2
Upload your solution into [[https://cw.felk.cvut.cz/brute/|BRUTE]] as a zip archive containing only the file ''simplify.c'' and either a Makefile or readme explaining how to compile it.