uva 10361 - Automatic Poetry
来源:互联网 发布:python输入ctrl c 编辑:程序博客网 时间:2024/06/05 14:16
Problem I
Automatic Poetry
Input: standard input
Output: standard output
Time Limit: 2 seconds
Memory Limit: 32 MB
“Oh God”, Lara Croft exclaims, “it’s one of these dumb riddlesagain!”
In Tomb Raider XIV, Lara is, as ever, gunning her way throughancient Egyptian pyramids, prehistoric caves and medival hallways.Now she is standing in front of some important Germanic lookingdoorway and has to solve a linguistic riddle to pass. As usual, theriddle is not very intellectually challenging.
This time, the riddle involves poems containing a“Schuttelreim”. An example of a Schuttelreim is the following shortpoem:
Ein Kind halt seinen Schnabel nur,
wenn es hangt an derNabelschnur.
A Schuttelreim seems to be a typical German invention. The funnything about this strange type of poetry is that if somebody givesyou the first line and the beginning of the second one, you cancomplete the poem yourself. Well, even a computer can do that, andyour task is to write a program which completes them automatically.This will help Lara concentrate on the “action” part of Tomb Raiderand not on the “intellectual” part.
Input
The input will begin with a line containing a single number n.After this line follow n pairs of lines containing Schuttelreims.The first line of each pair will be of the form
s1<s2>s3<s4>s5
where the si are possibly empty, strings of lowercasecharacters or blanks. The second line will be a string of lowercasecharacters or blanks ending with three dots “...”. Lines will we atmost 100 characters long.
Output
For each pair of Schuttelreim lines l1 andl2 you are to output two lines c1 andc2 in the following way: c1 is the same asl1 only that the bracket marks “<” and“>” are removed. Line c2 is the same asl2 , except that instead of the three dots the strings4s3s2s5 shouldappear.
Sample Input
3
ein kind haelt seinen <schn>abel<n>ur
wenn es haengt an der ...
weil wir zu spaet zur <>oma<k>amen
verpassten wir das ...
<d>u<b>ist
...
Sample Output
ein kind haelt seinen schnabel nur
wenn es haengt an der nabel schnur
weil wir zu spaet zur oma kamen
verpassten wir das koma amen
du bist
bu dist
代码:
#include<stdio.h>
#include<string.h>
int main()
}
- uva 10361 - Automatic Poetry
- AUTOMATIC UNDO INTERNALS
-  
-
- ACM: uva 1335 - Beijing Guards
- ACM: uva 10391 - Compound Words
- ACM: uva 10534 - Wavio Sequence
- ACM: uva 11538 - Chess Queen
- ACM: uva 1073 - Glenbow Museum
- UVa 10300 Ecological Premium
- uva 401 - Palindromes
- ACM: 数学题 uva 11300
- ACM: uva 11584 -
- uva UVa 537 Artificial Intellige…
- Automatic Memory Management(AMM)…
- UVA 10189 C - MINES p
- ACM: uva 11174 - Stand in a Line
- uva 11354 Bond
- 怎么在外部类的静态方法中创建成员内部类的对象?
- uva 10055 Hashmat the brave warr…
- 488 - Triangle Wave
- UVa 10300 Ecological Premium
- uva 10010 - Where's Waldorf?
- uva 10361 - Automatic Poetry
- uva 401 - Palindromes
- uva UVa 537 Artificial Intellige…
- 409 Excuses, Excuses!
- 424 - Integer Inquiry
- 10106 - Product
- 465 - Overflow
- 安卓:内容提供者(基础知识)
- Problem A