Senior Division



Download 8.57 Kb.
Date26.05.2017
Size8.57 Kb.
#19147

2002-2003

Contest #3

American Computer Science League



Senior Division



STRINGS AND THINGS
PROBLEM: Given a string of characters, answer some questions about the string.
INPUT: A string of characters. All letters will be upper case. The characters may not be entered one at a time or one word at a time.
OUTPUT:

1. How many words in the string

2. Print all the words in reverse order, ie STOP becomes POTS.

3. Write the words in alphabetical order

4. Print the words in the string in reverse order, ie I SEE HIM becomes HIM SEE I

5. Print all pairs of words in which one word in the string, containing more than one letter, is contained in another.


Example: HE HOPS WHEN HE SHOPS.

HOPS, SHOPS

HE, WHEN
IN A RIGHT TRIANGLE THE SQUARE OF THE HYPOTENUSE EQUALS THE SUM OF THE SQUARES OF THE LEGS.

SAMPLE OUTPUT


1. 18

2. NI A THGIR ELGNAIRT EHT ERAUQS FO EHT ESUNETOPYH SLAUQE EHT MUS FO EHT

SERAUQS FO EHT SGEL

3. A EQUALS HYPOTENUSE IN LEGS OF RIGHT SQUARE SQUARES SUM THE TRIANGLE

4. LEGS THE OF SQUARES THE OF SUM THE EQUALS HYPOTENUSE THE OF SQUARE THE

TRIANGLE RIGHT A IN

5. SQUARE, SQUARES


2002-2003


Contest #3

American Computer Science League



Senior Division



STRINGS AND THINGS
TEST DATA
TEST INPUT
LES TELL TELLS ILL TILLED TELLTALES
TEST OUTPUT
1. 6

2. SEL LLET SLLET LLI DELLIT SELATLLET

3. ILL LES TELL TELLS TELLTALES TILLED

4. TELLTALES TILLED ILL TELLS TELL LES

5. LES TELLTALES

TELL TELLS



TELL TELLTALES

ILL TILLED

Download 8.57 Kb.

Share with your friends:




The database is protected by copyright ©ininet.org 2024
send message

    Main page