Time limit per test
2 seconds
Memory limit per test
256 megabytes
Input
Standard Input
Output
Standard output
One day, liouzhou_101 got a chat record of Freda and rainbow. out of curiosity, he wanted to know which sentences were said by Freda, and which were said by rainbow. according to his experience, he thought that Freda always said"Lala."
At the end of her sentences, while rainbow always said"Miao."At the beginning of his sentences. For each sentence in the chat record, help
Liouzhou_101 find whose sentence it is.
Input
The first line of the input contains an integer N ( 1 bytes ≤ bytesNLimit ≤ limit 10 ),
Number of sentences in the chat record. Each of the next N Lines contains a sentence. A sentence is a string that contains only Latin letters
( A-Z , A-z ), Underline ( _ ),
Comma ( , ), Point ( . ) And Space
( ). Its length doesn't exceed 100.
Output
For each sentence, output" Freda's "If the sentence was said by Freda ," Rainbow's "
If the sentence was said by rainbow, or" OMG>. <I don't know! "If liouzhou_101 can't recognize whose sentence it is. He can't recognize a sentence
If it begins" Miao. "And ends" Lala. ",
Or satisfies neither of the conditions.
Sample test (s) Input
5I will go to play with you Lala. Wow, welcome. Miao. Lala. Miao. Miao.
Output
Freda 'somg>. <I don't know! OMG>. <I don't know! Rainbow 'somg>. <I don't know!
Problem description: This question needs to judge the front and back strings of a string. Each person corresponds to a different string. Note that the feature is superimposed and cannot be determined at this time. A function is used here.Strstr, this functionThis function is used to search for the first occurrence string of a specified string (including all subsequent strings). In this question, strstr (S, "Miao. ") is to return the first Miao. the entire substring starting with and ending.
# include
# include
# include
# include
# include
# include
# include
# include
using namespace STD; int main () {int I, n; int K, length; char s [1000]; scanf ("% d", & N); getchar (); for (I = 0; I
4 & strcmp (S + Length-5, "Lala. ") = 0) {k ++;} If (strstr (S," Miao. ") = s) {k + = 10;} If (k = 1) {Printf ("Freda's \ n");} else if (k = 10) {printf ("Rainbow's \ n ");} else {printf ("OMG>.