Dian

Páginas: 2 (485 palabras) Publicado: 28 de abril de 2012
Diccionario portuñol

Portuñol is a special language that was naturally developed in Latin America. Since almost half of Latin America speaks Portuguese (Português) and almost half speaks Spanish(Español), the mixing of both languages is natural.
Each word in Portuñol is made by taking a non-empty prefix of a Portuguese word and a nonn empty suffix of a Spanish word, and concatenating themtogether. A prefix of a word is any word that can be obtained by erasing zero or more characters from its right end. A suffix of a word is any word that can be obtained by erasing zero or morecharacters from its left end. The name of the language itself comes from taking a prefix of the word ``Português" (Portu) and a suffix of the word ``Español" (ñol), and concatenating them.
Of course, notevery possible way of combining two words will result in something meaningful, or even pronounceable, but that is not important. We want you to write a program to count the number of different Portuñolwords.
You will be given two non-empty sets of words to test your program. The first set will represent Portuguese words and the second set will represent Spanish words. You need to calculate thenumber of different Portuñol words that can be made using the prefix and suffix rule described above. Note that the same word may be constructed in several ways, but it still needs to be counted as one.Also note that the input sets are just to test your program, so they do not need to be made out of actual Portuguese or Spanish words.
Input 
Each test case is described using several lines. The firstline contains two integers P and S representing respectively the number of Portuguese words and the number of Spanish words (1P, S1000). Each of the next P lines contains a Portuguese word, and afterthat each of the next Slines contains a Spanish word. Each word is a non-empty string of at most 1000 characters; each character is one of the 26 standard lowercase letters (from `a' to `z'). You...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Diana
  • Diana
  • Diana
  • diana
  • diana
  • Diana
  • Diana
  • diana

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS