Sewickley Academy Programming Team
Programming Contest:  23-Feb-2001
David Kosbie (Faculty Advisor)
Sewickley Academy

Link to Programming Contests home page.

Quick Questions

Special Rule:  You only have 30 minutes, not 40 minutes.

Question 1:   Without using any functions from math.h, read in a floating point number larger than 1 and output its cubed root to within 0.001.  Hint:  use binary search.

Question 2:  Read in a list of words, all on one line (thus, terminated by the end-of-line), and output the smallest word.

Question 3:  Read in a number N and output the number of composite (non-Prime) numbers larger than 3 and smaller than N the digits of which, when added together, are divisible by 5.  Hence, 28 is such a number, as 28 is composite (it is 7 * 4) and 2  + 8 = 10, which is divisible by 5.

Question 4:  Read in a month as an integer (where 1 is January, and 12 is December) followed by the day of the week of the first day of that month (where 1 is Sunday and 7 is Saturday), and output the number of Saturdays that occur in that month.

Hint:  Months with 31 days:  January, March, May, July, August, October, December.
Months with 28 days:  February (no leap year)
Months with 30 days:  All others.
Question 5:  Read in 6 floating point numbers,  x1, y1, x2, y2, x3, y3, and output "yes" if they are collinear, and "no" otherwise.  Hint:  If they are collinear, then the point (x3,y3) falls on the line described by (x1,y1) and (x2,y2).