25-10-2016, 12:13 PM
1461058477-CROC2012Problems.pdf (Size: 74.49 KB / Downloads: 2)
General Things to Note
1. The format of your answer should match that of the sample output exactly! Not
doing so may result in 0 points for the problem. The only exception is when you
are asked to plot a graph. It is not required that your graph must look a certain
way pixel for pixel.
2. The name of the source file for each problem should be what is in parentheses next
to the bolded name of the problem.
General Things about the competition
1. we will also have 1 or 2 plotting problems similar to the ones from the text book.
2. generally most of the problems are referenced from the text books.
3. problems may involve the use of some basic programing and logic flow. for example
students should know how to use if statements, for loops, and while loops.
4. students should know how to read in input. a lot of the problems read in multiple
inputs on one line.
5. student should know how to print outputs on the same line / on different lines
Rational Numbers (rational.c) 2 Points
A rational number can be expressed as the ratio of two integers. But the ratio is not
unique because a rational number can be expressed with different ratios. For example, 1
2
is equal to 5
10 . Write a program that will determine if two fractions are the same.
Input and Output Format You will be given four integers a, b, c, and d in that order.
They express two rational numbers in the forms a
b
and c
d
. All the inputs are read in
a single line. the next line is your output. it will be either ”True” if the fractions are
equivalent., or ”False” if the fractions are not equivalent.
Assumptions
1. a, b, c, and d will all be positive, so none of them will be zero or negative.
Sample Outputs
15 20 75 100
>True
17 21 18 29
>False