cf 8a Train and Peter
来源:互联网 发布:杭州淘宝培训学校 编辑:程序博客网 时间:2024/05/16 02:00
#include <iostream>#include <cstdio>#include <algorithm>using namespace std;int main(){ string s,s1,s2; bool f1=false,f2=false; cin>>s>>s1>>s2; int a,b; a=s.find(s1); if(a!=std::string::npos) { b=s.find(s2,a+s1.length()); if(b!=std::string::npos) f1=true; } string ss=""; for(int i=s.length()-1;i>=0;i--) ss+=s[i]; a=ss.find(s1); if(a!=std::string::npos) { b=ss.find(s2,a+s1.length()); if(b!=std::string::npos) f2=true; } if(f1&&f2) printf("both\n"); else if(f1) printf("forward\n"); else if(f2) printf("backward\n"); else printf("fantasy\n"); return 0;}
0 0
- CF 8A Train and Peter
- cf 8a Train and Peter
- 8A - Train and Peter
- 【String::find】#8 A. Train and Peter
- CodeForces 8A - Train and Peter
- CodeForces 8A Train and Peter (简单模拟题)
- Codeforces Beta Round #8 A. Train and Peter KMP
- Codeforces Beta Round #8A Train and Peter (string的运用)
- CF 553E Kyoya and Train
- cf#339-C - Peter and Snow Blower-简单几何
- CF Peter and Snow Blower 简单计算几何
- CodeForces 613A Peter and Snow Blowe
- codeforces 613A Peter and Snow Blower
- CodeForces 613 A. Peter and Snow Blower(计算几何)
- (CF)A. Vanya and Cards
- A. Gabriel and Caterpillar(cf)
- cf,A. Mashmokh and Lights
- cf 760A Petr and a calendar
- Corona学习之composer<1>
- Perl中的函数的定义和使用
- uvaoj 10253 - Series-Parallel Networks
- 指针就算指向了常量也不能修改这个常量
- Python代码的多线程改造
- cf 8a Train and Peter
- (十四)洞悉linux下的Netfilter&iptables:开发一个match模块【实战】
- C语言第三章:C语言和程序结构
- 使用jquery实现点击按钮弹出层和点击空白处隐藏层
- C3P0连接池初始化过程分析之一
- Android手机中跑Ubuntu系统
- cf 9a Die Roll
- C语言单链表,双向链表,循环单链表,循环双链表的基本操作
- C语言第四章:函数