题目链接:

https://vjudge.net/problem/POJ-1936

题目大意:

给两个字符串,判断是s1是不是s2的子序列

思路:

水

 #include<iostream>
#include<string>
#include<vector>
#include<cstring>
using namespace std;
int main()
{
string s1, s2;
while(cin >> s1 >> s2)
{
int i = , j = , tot = ;
for(; i < s1.size() && j < s2.size();)
{
if(s1[i] == s2[j])
{
tot++;
i++;
j++;
}
else j++;
}
if(tot == s1.size())cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}
return ;
}

POJ-1936 All in All---字符串水题的更多相关文章

  1. POJ 1936 All in All 匹配, 水题 难度:0

    题目 http://poj.org/problem?id=1936 题意 多组数据,每组数据有两个字符串A,B,求A是否是B的子串.(注意是子串,也就是不必在B中连续) 思路 设置计数器cnt为当前已 ...

  2. 1222: FJ的字符串 [水题]

    1222: FJ的字符串 [水题] 时间限制: 1 Sec 内存限制: 128 MB 提交: 92 解决: 20 统计 题目描述 FJ在沙盘上写了这样一些字符串: A1  =  “A” A2  =   ...

  3. 1001 字符串“水”题(二进制,map,哈希)

    1001: 字符串“水”题 时间限制: 1 Sec  内存限制: 128 MB提交: 210  解决: 39[提交][状态][讨论版] 题目描述 给出一个长度为 n 的字符串(1<=n<= ...

  4. 第十一届“蓝狐网络杯”湖南省大学生计算机程序设计竞赛 B - 大还是小? 字符串水题

    B - 大还是小? Time Limit:5000MS     Memory Limit:65535KB     64bit IO Format: Description 输入两个实数,判断第一个数大 ...

  5. [POJ 1000] A+B Problem 经典水题 C++解题报告 JAVA解题报告

        A+B Problem Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 311263   Accepted: 1713 ...

  6. HDU ACM 1073 Online Judge -&gt;字符串水题

    分析:水题. #include<iostream> using namespace std; #define N 5050 char a[N],b[N],tmp[N]; void Read ...

  7. POJ 1061 青蛙的约会 数论水题

    http://poj.org/problem?id=1061 傻逼题不多说 (x+km) - (y+kn) = dL 求k 令b = n-m ; a = x - y ; 化成模线性方程一般式 : Lx ...

  8. 【UVA - 1644 / POJ - 3518】Prime Gap(水题)

    Prime Gap 这里直接写中文了 Descriptions: 对于一个数n,若n为素数则输出0,否则找到距离n最小的两个素数,一个大于n,一个小于n,输出他们的差(正数) Input 多组输入 每 ...

  9. POJ 2014:Flow Layout 模拟水题

    Flow Layout Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3091   Accepted: 2148 Descr ...

  10. POJ 3080 (字符串水题) Blue Jeans

    题意: 找出这些串中最长的公共子串(长度≥3),如果长度相同输出字典序最小的那个. 分析: 用库函数strstr直接查找就好了,用KMP反而是杀鸡用牛刀. #include <cstdio> ...

随机推荐

  1. CodeForces 116C 【BFS】

    思路: 求所有树的最大高度? 注意:所有树从树根开始? #include <bits/stdc++.h> using namespace std; typedef long long LL ...

  2. Filter&Listener

    Filter&Listener 内容待补充... ...

  3. A^B mod (大数运算)

    #include<iostream> #include<cstdio> #include<cstring> using namespace std; ; ; cha ...

  4. 解决spark-shell输出日志信息过多

    import org.apache.log4j.Logger import org.apache.log4j.Level Logger.getLogger("org").setLe ...

  5. mycat1.6.5分片(字符串拆分hash)

    https://blog.csdn.net/webnum/article/details/78313525   分片规则:字符串拆分hash 一.conf/schema.xml文件   <?xm ...

  6. DB2的常用数据类型

    今天在db2中查询数据时出现错误: Overflow occurred during numeric data type conversion:SQLCODE=-413, SQLSTATE=22003 ...

  7. WebSocket Client连接AspNetCore SignalR Json Hub

    突然有个需求,需要使用普通的websocket客户端去连接SignalR服务器. 因为使用的是.net core 版的signalr,目前对于使用非signalr客户端连接的中文文档几乎为0,在gay ...

  8. CentOS 7 iptables 开放8080端口

    # 安装iptables-services [root@localhost bin]# yum install iptables-services [root@localhost bin]# /bin ...

  9. (转)CentOS系统启动流程图文详解

    CentOS系统启动流程图文详解. 原文:http://www.linuxidc.com/Linux/2017-03/141966.htm 熟悉系统启动流程对于我们学习Linux系统是非常有帮助的,虽 ...

  10. JavaScript函数体系

    第4章  JavaScript函数 1. 函数基本介绍 ① 为什么需要函数 函数最大的好处就是将零散的代码封装到了一起,当我们要再次使用该功能的时候,不需要再重新书写代码,只需要调用封装好的函数就可以 ...