A. Whose sentence is it?

Time Limit: 20 Sec

Memory Limit: 256 MB

题目连接

http://codeforces.com/contest/312/problem/A

Description

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 ≤ n ≤ 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 with "miao." and ends with "lala.", or satisfies neither of the conditions.

Sample Input

5
I will go to play with you lala.
wow, welcome.
miao.lala.
miao.
miao .

Sample Output

Freda's
OMG>.< I don't know!
OMG>.< I don't know!
Rainbow's
OMG>.< I don't know!

HINT

题意

给你一行字符串,如果前5个字符是miao.,那么这句话就是R说的

如果最后五个字符时lala.,那么这句话就是F说的

给你一个字符串,问你能否分辨出是谁说的呢?

题解:

水题啦,只用判断前五个和后五个字符啦

代码:

#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std; string s;
int main()
{
int n;
scanf("%d",&n);getchar();
for(int i=;i<n;i++)
{
getline(cin,s);
if(s.size()<)
{
printf("OMG>.< I don't know!\n");
continue;
}
int flag1 = ,flag2 = ;
int len = s.size();
if(s[]=='m'&&s[]=='i'&&s[]=='a'&&s[]=='o'&&s[]=='.')
flag1 = ;
if(s[len-]=='l'&&s[len-]=='a'&&s[len-]=='l'&&s[len-]=='a'&&s[len-]=='.')
flag2 = ;
if(flag1==flag2)
printf("OMG>.< I don't know!\n");
else if(flag1)
printf("Rainbow's\n");
else if(flag2)
printf("Freda's\n");
}
}

Codeforces Round #185 (Div. 2) A. Whose sentence is it? 水题的更多相关文章

  1. Codeforces Round #368 (Div. 2) A. Brain's Photos (水题)

    Brain's Photos 题目链接: http://codeforces.com/contest/707/problem/A Description Small, but very brave, ...

  2. Codeforces Round #373 (Div. 2) C. Efim and Strange Grade 水题

    C. Efim and Strange Grade 题目连接: http://codeforces.com/contest/719/problem/C Description Efim just re ...

  3. Codeforces Round #373 (Div. 2) A. Vitya in the Countryside 水题

    A. Vitya in the Countryside 题目连接: http://codeforces.com/contest/719/problem/A Description Every summ ...

  4. Codeforces Round #371 (Div. 2) A. Meeting of Old Friends 水题

    A. Meeting of Old Friends 题目连接: http://codeforces.com/contest/714/problem/A Description Today an out ...

  5. Codeforces Round #355 (Div. 2) B. Vanya and Food Processor 水题

    B. Vanya and Food Processor 题目连接: http://www.codeforces.com/contest/677/problem/B Description Vanya ...

  6. Codeforces Round #310 (Div. 2) B. Case of Fake Numbers 水题

    B. Case of Fake Numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/5 ...

  7. Codeforces Round #309 (Div. 2) B. Ohana Cleans Up 字符串水题

    B. Ohana Cleans Up Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/554/pr ...

  8. Codeforces Round #309 (Div. 2) A. Kyoya and Photobooks 字符串水题

    A. Kyoya and Photobooks Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/5 ...

  9. Codeforces Round #331 (Div. 2) A. Wilbur and Swimming Pool 水题

    A. Wilbur and Swimming Pool Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/conte ...

随机推荐

  1. java之URL类

    Java的网络类可以让你通过网络或者远程连接来实现应用.而且,这个平台现在已经可 以对国际互联网以及URL资源进行访问了.Java的URL类可以让访问网络资源就像是访问你本地的文件夹一样方便快捷.我们 ...

  2. Vagrant搭建Ubuntu-JavaEE开发环境——Tomcat+JDK+MySQL+dubbo+测试

    Vagrant搭建(Tomcat8+JDK7+MySQL5+dubbo) JDK 1.下载jdk 2.解压JDK tar -xzvf jdk-7u79-linux-x64.tar.gz 3.设置环境变 ...

  3. 【WEB小工具】EncodingFilter—设置全局编码

    1.我们知道,如果是POST请求,我们需要调用request.setCharacterEncoding("utf-8") 方法来设计编码. public void doGet(Ht ...

  4. Android 项目利用 Android Studio 和 Gradle 打包多版本APK

    在项目开发过程中,经常会有需要打包不同版本的 APK 的需求. 比如 debug版,release版,dev版等等. 有时候不同的版本中使用到的不同的服务端api域名也不相同. 比如 debug_ap ...

  5. ylbtech-数据库设计与优化-对作为复选框/单选列表的集合表的设计

    ylbtech-DatabaseDesgin:ylbtech-数据库设计与优化-对作为复选框/单选列表的集合表的设计 -- DatabaseName:通用表结构-- -- 主要是针对将要设计的表对象, ...

  6. HDU-3280 Equal Sum Partitions

    http://acm.hdu.edu.cn/showproblem.php?pid=3280 用了简单的枚举. Equal Sum Partitions Time Limit: 2000/1000 M ...

  7. memcpy、memmove、memset及strcpy函数实现和理解

    memcpy.memmove.memset及strcpy函数实现和理解 关于memcpy memcpy是C和C++ 中的内存拷贝函数,在C中所需的头文件是#include<string.h> ...

  8. ORA-15063: ASM discovered an insufficient number of disks for diskgroup "ASM,KEL"

    在启动ASM的时候报错,报错如下: SQL> startup ASM instance started Total System Global Area 130023424 bytes Fixe ...

  9. 树-哈夫曼树(Huffman Tree)

    概述 哈夫曼树:树的带权路径长度达到最小. 构造规则 1. 将w1.w2.-,wn看成是有n 棵树的森林(每棵树仅有一个结点): 2. 在森林中选出根结点的权值最小的两棵树进行合并,作为一棵新树的左. ...

  10. ASP.NET MVC之Html.RenderAction

    WEB窗体模式开发惯了,切入MVC模式,好多东西都不懂,每一步都要查资料. 初步得来的一些知识点体会是: _Layout.cshtml就相当于母版页 然后partical视图(部分视图)就是用户控件. ...