Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Language: Choose Your Own Adventure
Description After reading the book Tim and Marc Kill Kenny about fifty zillion times, James decided he'd had it with choose-your-own-adventure stories. No matter what choices he made, it seemed like Kenny always fell down an abandoned mine shaft, got run over by a bus load of nuns, or was messily devoured by stray cats. James eventually found the page with the happy ending (where Kenny saves himself by trapping Tim and Marc between the pizza and the hungry programmers) by flipping through the book, but he can't figure out how to get there by following the rules. Luckily, he owns a C compiler... Input Input to this problem will consist of a (non-empty) series of up to 100 data sets, each representing a choose-your-own-adventure story. Each data set will be formatted according to the following description, and there will be no blank lines separating data sets.
The first line contains a single integer n indicating the number of data sets. A single data set has 2 components:
Output For each story in the input:
Sample Input 2 3 C "Arrived at LSU for the contest" 2 3 E "Was devoured by sidewalk ants" GRISLY E "Won the contest. Received glory and nachos." HAPPY 5 C "Saw a peanut" 3 5 E "Made peanut butter sandwich" HAPPY C "Found a hammer" 4 2 E "Hit self on head with hammer, ouch!" GRISLY E "Ate the peanut, choked on it, and died" GRISLY Sample Output STORY 1 Arrived at LSU for the contest Won the contest. Received glory and nachos. STORY 2 Saw a peanut Found a hammer Made peanut butter sandwich Source |
[Submit] [Go Back] [Status] [Discuss]
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator