#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
int main()
{
string s;
int test, l, i;
int c1, c2, c3;
scanf("%d", &test);
cin.ignore();
while(test--)
{
getline(cin, s);
l=s.length();
c1=c2=c3=0;
for(i=0; i<l; i++)
{
if ((s[0] == 'm' && s[1] == 'i' && s[2] == 'a' && s[3] == 'o' && s[4] == '.')
&& (s[l-5] == 'l' && s[l-4] == 'a' && s[l-3] == 'l' && s[l-2] == 'a' && s[l-1]== '.') )
{
c3=3;
}
else if(s[0] == 'm' && s[1] == 'i' && s[2] == 'a' && s[3] == 'o' && s[4] == '.')
{
c1=1;
}
else if(s[l-5] == 'l' && s[l-4] == 'a' && s[l-3] == 'l' && s[l-2] == 'a' && s[l-1] == '.')
{
c2=2;
}
else
{
c3=3;
}
}
if(c1==1)
{
printf("Rainbow's\n");
}
else if(c2==2)
{
printf("Freda's\n");
}
else if(c3==3)
{
printf("OMG>.< I don't know!\n");
}
}
}
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
int main()
{
string s;
int test, l, i;
int c1, c2, c3;
scanf("%d", &test);
cin.ignore();
while(test--)
{
getline(cin, s);
l=s.length();
c1=c2=c3=0;
for(i=0; i<l; i++)
{
if ((s[0] == 'm' && s[1] == 'i' && s[2] == 'a' && s[3] == 'o' && s[4] == '.')
&& (s[l-5] == 'l' && s[l-4] == 'a' && s[l-3] == 'l' && s[l-2] == 'a' && s[l-1]== '.') )
{
c3=3;
}
else if(s[0] == 'm' && s[1] == 'i' && s[2] == 'a' && s[3] == 'o' && s[4] == '.')
{
c1=1;
}
else if(s[l-5] == 'l' && s[l-4] == 'a' && s[l-3] == 'l' && s[l-2] == 'a' && s[l-1] == '.')
{
c2=2;
}
else
{
c3=3;
}
}
if(c1==1)
{
printf("Rainbow's\n");
}
else if(c2==2)
{
printf("Freda's\n");
}
else if(c3==3)
{
printf("OMG>.< I don't know!\n");
}
}
}
No comments:
Post a Comment