CodeForces 8A - Train and Peter
来源:互联网 发布:中国交通事故数据统计 编辑:程序博客网 时间:2024/04/29 14:11
题目意思很明确。。。。。开始用string.find(),就是在第14个测试点wa,然后用了strstr();
#include <iostream>#include <cstdio>#include <string>#include <cstring>#include <algorithm>using namespace std;int main(){char str[100005],str1[100005],str2[100005];scanf("%s%s%s",str,str1,str2);int flag1,flag2;flag1=strstr(str,str1)&&strstr(strstr(str,str1)+strlen(str1),str2);reverse(str,str+strlen(str));flag2=strstr(str,str1)&&strstr(strstr(str,str1)+strlen(str1),str2); if(flag1&&flag2) cout<<"both\n"; else if(!flag1&&!flag2) cout<<"fantasy\n"; else if(flag1) cout<<"forward\n"; else cout<<"backward\n"; return 0;}
0 0
- CodeForces 8A - Train and Peter
- 8A - Train and Peter
- CodeForces 8A Train and Peter (简单模拟题)
- Codeforces Beta Round #8 A. Train and Peter KMP
- 【String::find】#8 A. Train and Peter
- CF 8A Train and Peter
- cf 8a Train and Peter
- Codeforces Beta Round #8A Train and Peter (string的运用)
- CodeForces 613A Peter and Snow Blowe
- codeforces 613A Peter and Snow Blower
- CodeForces 613 A. Peter and Snow Blower(计算几何)
- Peter and Snow Blower CodeForces
- Codeforces Peter 614 C and Snow Blower
- codeforces 614 C Peter and Snow Blower
- CodeForces 614C Peter and Snow Blower
- Codeforces 614C Peter and Snow Blower
- CodeForces 614C. Peter and Snow Blower
- Codeforces Peter 614 C and Snow Blower
- 使用VMware新建Ubuntu虚拟机
- java的访问权限
- 线索树的基本例程:(2)
- SCMHttpclient
- 优先级反转及解决办法
- CodeForces 8A - Train and Peter
- Java的异常处理
- Windows环境,svn服务器地址换了,如何更新本地工作目录
- jQuery 选择器大全
- hot code replace failed
- linux查询rpm包详细信息
- 【Nginx】基于HTTP的反向代理
- linux常用命令(15):tail命令
- 作为一个面试官,我会这样问问题——面试攻略之见招拆招