题意:字符串匹配,看样例输入理解题意

直接循环

  1. #include <string>
  2. #include<iostream>
  3. #include<map>
  4. #include<memory.h>
  5. #include<vector>
  6. #include<algorithm>
  7. #include<queue>
  8. #include<vector>
  9. #include<stack>
  10. #include<math.h>
  11. #include<iomanip>
  12.  
  13. namespace cc
  14. {
  15. using std::cout;
  16. using std::endl;
  17. using std::cin;
  18. using std::map;
  19. using std::vector;
  20. using std::string;
  21. using std::sort;
  22. using std::priority_queue;
  23. using std::greater;
  24. using std::vector;
  25. using std::swap;
  26. using std::stack;
  27.  
  28. constexpr double MD = 1e-;
  29.  
  30. void solve()
  31. {
  32. string str1, str2;
  33. while (cin>>str1>>str2)
  34. {
  35. int ok = ;
  36. for (int i=;i<str2.length();i++)
  37. {
  38. if (str2[i] == str1[])
  39. {
  40. int k = ;
  41. for (int j=i+;j<str2.length()&&k<str1.length();j++)
  42. {
  43. if (str2[j] == str1[k])
  44. ++k;
  45. }
  46. if (k == str1.length())
  47. {
  48. ok = ;
  49. break;
  50. }
  51. }
  52. }
  53. if (ok)
  54. cout << "Yes" << endl;
  55. else
  56. cout << "No" << endl;
  57. }
  58.  
  59. }
  60.  
  61. };
  62.  
  63. int main()
  64. {
  65.  
  66. #ifndef ONLINE_JUDGE
  67. freopen("d://1.text", "r", stdin);
  68. #endif // !ONLINE_JUDGE
  69. cc::solve();
  70.  
  71. return ;
  72. }

uva-10340-水题的更多相关文章

  1. UVa 1595 (水题) Symmetry

    颓废的一个下午,一直在切水题,(ˉ▽ ̄-) 首先如果这些点是对称的话,那么它们的对称轴就是x = m,m是横坐标的平均值. 把这些点放到一个集合里,然后扫描每个点,计算出它关于x = m的对称点,看这 ...

  2. UVa 10391 (水题 STL) Compound Words

    今天下午略感无聊啊,切点水题打发打发时间,=_=|| 把所有字符串插入到一个set中去,然后对于每个字符串S,枚举所有可能的拆分组合S = A + B,看看A和B是否都在set中,是的话说明S就是一个 ...

  3. UVa 10935 (水题) Throwing cards away I

    直接用STL里的queue模拟即可. #include <cstdio> #include <queue> using namespace std; ; int discard ...

  4. UVa 1593 (水题 STL) Alignment of Code

    话说STL的I/O流用的还真不多,就着这道题熟练一下. 用了两个新函数: cout << std::setw(width[j]);    这个是设置输出宽度的,但是默认是在右侧补充空格 所 ...

  5. UVa 400 (水题) Unix ls

    题意: 有n个文件名,排序后按列优先左对齐输出.设最长的文件名的长度为M,则最后一列长度为M,其他列长度为M+2. 分析: 这道题很简单,但要把代码写的精炼,还是要好好考虑一下的.lrj的代码中有两个 ...

  6. UVa 11040 (水题) Add bricks in the wall

    题意: 45块石头如图排列,每块石头上的数等于下面支撑它的两数之和,求其余未表示的数. 分析: 首先来计算最下面一行的数,A71 = A81 + A82 = A91 + 2A92 + A93,变形得到 ...

  7. Square Numbers UVA - 11461(水题)

    #include <iostream> #include <cstdio> #include <sstream> #include <cstring> ...

  8. UVa 489 HangmanJudge --- 水题

    UVa 489 题目大意:计算机给定一个单词让你猜,你猜一个字母,若单词中存在你猜测的字母,则会显示出来,否则算出错, 你最多只能出错7次(第6次错还能继续猜,第7次错就算你失败),另注意猜一个已经猜 ...

  9. UVa 1339 Ancient Cipher --- 水题

    UVa 1339 题目大意:给定两个长度相同且不超过100个字符的字符串,判断能否把其中一个字符串重排后,然后对26个字母一一做一个映射,使得两个字符串相同 解题思路:字母可以重排,那么次序便不重要, ...

  10. UVa 1225 Digit Counting --- 水题

    UVa 1225 题目大意:把前n(n<=10000)个整数顺次写在一起,12345678910111213...,数一数0-9各出现多少字 解题思路:用一个cnt数组记录0-9这10个数字出现 ...

随机推荐

  1. webdriver 启动chrome时加载配置

    Selenium操作浏览器是不加载任何配置的,网上找了半天,关于Firefox加载配置的多点,Chrome资料很少,下面是关于加载Chrome配置的方法:  一.加载所有Chrome配置 用Chrom ...

  2. ALGO-145_蓝桥杯_算法训练_4-1打印下述图形

    记: 这里用到了printf("%*s%s%*s\n",n-i,"",arr,n-i,"");的写法, 其中%*s中的*代表该字符串s的个数 ...

  3. 高精度算r的n次方 问题 H: 乾隆巡江南

    问题 H: 乾隆巡江南 时间限制: 2 Sec  内存限制: 128 MB提交: 13  解决: 3[提交][状态][讨论版] 题目描述 话说乾隆带着他的宰相刘罗锅和你出巡江南,被杭州城府邀请去听戏, ...

  4. [转][C#]降级.net 源码4.5

    来自:https://www.cnblogs.com/had37210/p/8057042.html 主要是 Task 的降级: 1.net4.5.2 引入了 async/await 关键字. 这个其 ...

  5. UnicodeString基本操作(Ring0)

    #include "Unicode_String_Ring0.h" //bp Unicode_String_Ring0!DriverEntry NTSTATUS DriverEnt ...

  6. 制作OpenStack云平台centos6.5镜像

    创建虚拟镜像 # qemu-img create -f raw Cloud_Centos6.5_64bit.img 10G [root@localhost ~]# ll /opt/CentOS-6.5 ...

  7. static--Android静态变量使用陷阱

     相关资料:http://blog.csdn.net/ctcwri/article/details/8858414                     http://blog.csdn.net/w ...

  8. SCCM2012 R2实战系列之十二:解决OSD分发时间过长的问题

    对于SCCM 2012 R2的初学者来说,能够成功分发操作系统可能已经是非常兴奋了.但在企业中会遇到客户提出的各种各样苛刻的需求.所以在平时实验过程中多站点客户的角度想问题,尽可能的贴近企业实际生产环 ...

  9. orcale 函数wm_concat不存咋lob值使用zh_concat 替换

    create or replace TYPE zh_concat_im AUTHID CURRENT_USER AS OBJECT ( CURR_STR VARCHAR2(32767), STATIC ...

  10. Go语言 函数,工程管理

    Go语言 函数,工程管理 1.无参无返回值函数的使用 package main import "fmt" func main() { // 无参无返回值函数的调用:函数名() fu ...