2002 Canadian Computing Competition, Stage 1
Problem J4/S2: Fraction Action
Many advanced calculators have a fraction feature that will simplify fractions for you.
You are to write a program that will accept for input a non-negative integer as a numerator and a positive integer as a denominator, and output the fraction in simplest form. That is, the fraction cannot be reduced any further, and the numerator will be less than the denominator. You can assume that all input numerators and denominators will produce valid fractions.
Examples
Input28 7
|
Input13 5
|
Input0 7
|
Input55 10
|
All Submissions
Best Solutions
Point Value: 5
Time Limit: 2.00s
Memory Limit: 16M
Added: Sep 28, 2008
Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
Comments (Search)
Because lots of you did this simultaneously.