1998 UE High School Programming Contest

Problem 1 Test Data

Input:

Please enter the text to be formatted: (Enter a blank line to end input.)
/t/b/uJeff's Snazzy Text Formatter/u/b/n
/n
If you can't spell it,/n
/tneither can /bI/b.
/
/q

Output:

    _JEFF'S_SNAZZY_TEXT_FORMATTER_
 
If you can't spell it,
    neither can I.q

Input:

Please enter the text to be formatted: (Enter a blank line to end input.)
/u/n/tThis should knock out a few./u/t/u/n Bob/n/t/u1/u/nPhlop

Output:

_
____This_should_knock_out_a_few._    _
_Bob
_____1_
Phlop

Input:

Please enter the text to be formatted: (Enter a blank line to end input.)
// All invalid / are ignore/d/. /n
/u/t/u/
/b/t/nBold/b

Output:

/ All invalid  are ignored.
______
BOLD

Input:

Please enter the text to be formatted: (Enter a blank line to end input.)
/bJohn's Unix Quick Reference/b/n/npine/n/tRun the Pine program./n/n
kill/n/tKill a job./n/n/n//* /uDon't kill someone else's job./u *//

Output:

JOHN'S UNIX QUICK REFERENCE
 
pine
    Run the Pine program.
 
kill
    Kill a job.
 
 
/* _Don't_kill_someone_else's_job._ */
 

Problem 2 Test Data

Welcome to the Wesselman's Summer Softball League!
 
How many teams are in this year's league? 1
Enter the name for team # 1  ? t1
How many players are on team # 1 ? 3
Name for player # 1 ? n1
The number of at bats for player # 1 ? 10
The number of hits for player # 1 ? 4
Name for player # 2 ? n2
The number of at bats for player # 1 ? 17
The number of hits for player # 1 ? 11
Name for player # 3 ? n3
The number of at bats for player # 1 ? 23
The number of hits for player # 1 ? 15
 
t1
 
Player n1                                 .400
Player n2                                 .647
Player n3                                 .652
 
------------
 
Welcome to the Wesselman's Summer Softball League!
 
How many teams are in this year's league? 0
 
-------------
 
Welcome to the Wesselman's Summer Softball League!
 
How many teams are in this year's league? 2
Enter the name for team # 1  ? t1
How many players are on team # 1 ? 1
Name for player # 1 ? n1
The number of at bats for player # 1 ? 19
The number of hits for player # 1 ? 11
 
Enter the name for team # 2  ? t2
How many players are on team # 2 ? 2
Name for player # 1 ? n1
The number of at bats for player # 2 ? 84
The number of hits for player # 2 ? 33
Name for player # 2 ? n2
The number of at bats for player # 2 ? 75
The number of hits for player # 2 ? 44
 
t1
 
Player n1                                 .579
 
 
t2
 
Player n1                                 .393
Player n2                                 .587

Problem 3 Test Data

Enter the x and y coordinates of the seismograph #1:
(Separate with commas): 13, 31
Enter the distance from seismograph #1: 58
 
Enter the x and y coordinates of the seismograph #2:
(Separate with commas): -60, 29
Enter the distance from seismograph #2: 55
 
Enter the x and y coordinates of the seismograph #3:
(Separate with commas): 42, -19
Enter the distance from seismograph #3: 115
 
The epicenter was located  27 miles west  and  73 miles north of New Madrid.
 
Would you like to determine the location of another earthquake? (y/n)?
 
-----------------------------------------------------------------------------------------------------------
 
Enter the x and y coordinates of the seismograph #1:
(Separate with commas): 26, 12
Enter the distance from seismograph #1: 87
 
Enter the x and y coordinates of the seismograph #2:
(Separate with commas): 41, 15
Enter the distance from seismograph #2: 75
 
Enter the x and y coordinates of the seismograph #3:
(Separate with commas): 101, 111
Enter the distance from seismograph #3: 39
 
The data entered was invalid.
 
Would you like to determine the location of another earthquake? (y/n)?
 
------------------------------------------------------------------------------------------------------------
 
Enter the x and y coordinates of the seismograph #1:
(Separate with commas): 0, 0
Enter the distance from seismograph #1: 30
 
Enter the x and y coordinates of the seismograph #2:
(Separate with commas): 0, 40
Enter the distance from seismograph #2: 10
 
Enter the x and y coordinates of the seismograph #3:
(Separate with commas): 10, 30
Enter the distance from seismograph #3: 10
 
The epicenter was located 30 miles north of New Madrid.
 
Would you like to determine the location of another earthquake? (y/n)?
 

Problem 4 Test Data

Do you want to play a game?   yes
United States  : enter number of shots per turn? 8
Russia         : enter number of shots per turn? 5
China          : enter number of shots per turn? 6
England        : enter number of shots per turn? 9
France         : enter number of shots per turn? 3
 
France          has died in turn 9 !
Russia          has died in turn 13 !
China           has died in turn 14 !
 
Allied victory: USA and England win in turn 14 !
 
--------------
 
Do you want to play a game?   no
 
(program ends)
 
--------------
 
Do you want to play a game?   yes
United States  : enter number of shots per turn? 100
Russia         : enter number of shots per turn? 100
China          : enter number of shots per turn? 100
England        : enter number of shots per turn? 100
France         : enter number of shots per turn? 100
 
Russia          has died in turn 1 !
England         has died in turn 1 !
France          has died in turn 1 !
United States   has died in turn 2 !
China           has died in turn 2 !
 
ALL PLAYERS ARE DEAD in turn 2 !
Strange game.  The only way to win is not to play.

Problem 6 Test Data

Please enter your string:
y
 
y
y
 
Would you like to enter another string? yes
 
Please enter your string:
how are you?
 
how are you?
ow are you?h
w are you?ho
 are you?how
are you?how
re you?how a
e you?how ar
 you?how are
you?how are
ou?how are y
u?how are yo
?how are you
how are you?
 
Would you like to enter another string? no
Thank you for using Rotate-O-String 2000.

Back to the 1998 Problem Set Page

Back to the Programming Contest Home Page