A. whose sentence is it?

Source: Internet
Author: User
Tags cmath
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>. 
           
          
         
        
       
      
     
    
   
  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.