[BOJ 6919] Fraction Action
View as PDF
Submit solution
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text
Points:
2
Time limit:
1.0s
Memory limit:
128M
Problem types
Allowed languages
Many advanced calculators have a fraction feature that will simplify fractions for you.</p>
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.
입력 형식
출력 형식
예제 입력 1
28
7
예제 출력 1
4
예제 입력 2
13
5
예제 출력 2
2 3/5
예제 입력 3
0
7
예제 출력 3
0
예제 입력 4
55
10
예제 출력 4
5 1/2
Comments