Elementary Division 1987

1. TOWER BUILDING
With the   *  symbol and the PRINT command any tower can be built.  

Write a program to generate the following tower with THREE or less 
print commands? 


      *
     ***
    *****
   *******






2. SAFE CRACKING
To open a safe requires knowing three single digits (1-9).  For 
example, the three digits  5 - 4 - 9  is a valid combination.  A secret 
message has been found that gives clues about the combination to the 
safe.

1. The digit 1 is not used.  
2. All of the digits are different.
3. The first digit plus 3 times the second digit plus 5 times the third 
digit is the same number as the product of all three digits.

Using these clues write a program to crack the safe. 

Sample Run

THE COMBINATION IS ? - ? - ?


3. BIRTHDAY OF THE WEEK
"On what day of the week were you born?" I asked this question of a 
group of 14 people and received six different answers. I expected to get 
seven different answers -- one for each day of the week (MONDAY, 
TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, 
AND SUNDAY). 

Call the day of the week you were born your BIRTHDAY OF THE 
WEEK.

Assume that every day of the week is equally likely to be a birthday of 
the week. What would the results be if you asked a group of 14 people 
to tell you their birthday of the week?

Write a program to simulate picking at random 14 birthdays of the 
week from the 7 possible days of the week.

Sample Run

RANDOM SAMPLE OF 14 BIRTHDAYS OF THE WEEK:

WED MON SAT TUE FRI TUE SUN MON MON
WED TUE SUN SAT WED 



4. WORD SEARCH
If you look carefully at the line of letters below you will recognize 
certain hidden words. Your job is to program the computer to find the 
words for you. 

Write a program to find the words: THE, BEST, CONTEST hidden in 
the line of letters:

SWFTHEGDCBESTFCONTESTYGFDSWER

Print out each word and the position in the line where it begins.

Sample Run

THE - BEGINS AT POSITION 4
BEST - BEGINS AT POSITION ?
CONTEST - BEGINS AT POSITION ?



5. NUMBER TRIANGLES
The numbers in the triangles below reveal a pattern for a NUMBER 
TRIANGLE. 

               1
               2 6
               3 7 10
               4 8 11 13
               5 9 12 14 15

Discover this pattern and write a program to generate NUMBER 
TRIANGLES for any size (number of rows) N  between 1 and 9.

Test your program for N equal to 5 and 9.

Sample Run

ENTER A SIZE N BETWEEN 1 AND 9: 3
 
            1
            2 4
            3 5 6

Sample Run

ENTER A SIZE N BETWEEN 1 AND 9: 5

            1
            2 6
            3 7 10
            4 8 11 13
            5 9 12 14 15



	ICPSC 1987
	Elementary Division Problems


