CF 312A(Whose sentence is it?-strstr(s,p))
来源:互联网 发布:手机双系统切换软件 编辑:程序博客网 时间:2024/06/10 04:20
strstr(s,p) //在s中找p,返回指向第一个子串首的指针,若无返回NULL.
gets(s) //读入一行.
#include<cstdio>#include<cstdlib>#include<cstring>#include<iostream>#include<algorithm>#include<functional>#include<cmath>#include<cctype>using namespace std;#define For(i,n) for(int i=1;i<=n;i++)#define Rep(i,n) for(int i=0;i<n;i++)#define Fork(i,k,n) for(int i=k;i<=n;i++)#define ForD(i,n) for(int i=n;i;i--)#define Forp(x) for(int p=pre[x];p;p=next[p])#define RepD(i,n) for(int i=n;i>=0;i--)int n;char s[1000+10],p1[10]="miao.",p2[10]="lala.";int main(){//freopen("CF312A.in","r",stdin);//freopen(".out","w",stdout);scanf("%d",&n);gets(s);while (n--){gets(s);int len=strlen(s);bool b1=(strstr(s,p1))==s,b2=(strstr(s+strlen(s)-strlen(p2),p2)==(s+strlen(s)-strlen(p2)));if (!(b1^b2)) puts("OMG>.< I don't know!"); else if (b1) puts("Rainbow's");else puts("Freda's");}return 0;}
- CF 312A(Whose sentence is it?-strstr(s,p))
- cf:Whose sentence is it?
- codeforces 312A.Whose sentence is it?
- CodeForces 312A Whose sentence is it?
- A. Whose sentence is it?
- codeforces_312A Whose sentence is it?
- CF#807 A. Is it rated?(水题)
- 0526 CF#807A&G2n#F Is it rated
- what’s a virtual destructor and when is it needed?
- Is It A Tree?
- Is it a tree?
- Is It A Tree?
- Is It A Tree?
- Is It A Tree?
- is it a prime
- Is It A Tree?
- Is It A Tree?
- Is It A Tree?
- Dynamics CRM 2011编程系列(56):使用Business Connectivity Services 集成Sharepoint 2010 (上)
- Android通过Get,Post,HttpClient方式提交参数给服务器
- PHP中CURL_MULTI的使用方法简单示例
- servlet+jsp入门配置问题总结
- 表单重置
- CF 312A(Whose sentence is it?-strstr(s,p))
- ios 编译项目报:error: failed to attach to process ID 0
- C#操作串口,带异常处理,解决端口占用时打开串口出现异常错误,串口关闭时发送数据报错
- Eclipse通过General-Existing Projects into Workspace无法导入Android工程
- gdb core调试
- 数据库中两列放到Map中使用
- asp.net 读取Excel数据并将数据插入到数据库中
- 枚举
- 高精度数值