博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Lightoj1338——Hidden Secret!(模拟)
阅读量:2344 次
发布时间:2019-05-10

本文共 1521 字,大约阅读时间需要 5 分钟。

In this problem you are given two names, you have to find whether one name is hidden into another. The restrictions are:

  1. You can change some uppercase letters to lower case and vice versa.
  2. You can add/remove spaces freely.
  3. You can permute the letters.

And if two names match exactly, then you can say that one name is hidden into another.

Input

Input starts with an integer T (≤ 100), denoting the number of test cases.

Each case starts with two lines. Each line contains a name consists of upper/lower case English letters and spaces. You can assume that the length of any name is between 1 and 100 (inclusive).

Output

For each case, print the case number and “Yes” if one name is hidden into another. Otherwise print “No”.

Sample Input

3
Tom Marvolo Riddle
I am Lord Voldemort
I am not Harry Potter
Hi Pretty Roar to man
Harry and Voldemort
Tom and Jerry and Harry
Output for Sample Input
Case 1: Yes
Case 2: Yes
Case 3: No

主要是题意看了好久才懂。。。。

其实就是求两串字符串的字母是否一样,部分大小写

#include 
#include
#include
#include
#include
#include
#include
#include
#include
#define INF 0x3f3f3f3f#define MAXN 2005#define Mod 10001using namespace std;char a[MAXN],b[MAXN];int aa[MAXN],bb[MAXN];bool check(char &a){ if(a>='a'&&a<='z') { a-=32; return true; } if(a>='A'&&a<='Z') return true; return false;}int main(){ int t,cnt=1; scanf("%d",&t); getchar(); while(t--) { gets(a); gets(b); memset(aa,0,sizeof(aa)); memset(bb,0,sizeof(bb)); int lena=strlen(a),lenb=strlen(b); for(int i=0; i

转载地址:http://vpcvb.baihongyu.com/

你可能感兴趣的文章
IOS开发环境配置指南
查看>>
基于PhoneGap的iOS平台入门教程
查看>>
移动开发的未来将是PhoneGap的
查看>>
跨平台开发:初探PhoneGap移动开发框架
查看>>
基于PhoneGap的Windows Phone平台环境搭建教程
查看>>
在Eclipse下搭建Android开发环境教程
查看>>
关于搭建基于Android和PhoneGap开发环境图文详解
查看>>
基于PhoneGap的Android应用开发:Get started
查看>>
Dreamweaver 5.5、jQuery和PhoneGap开发移动应用
查看>>
详解关于PhoneGap框架学习教程
查看>>
基于PhoneGap与Java开发的Android应用的性能对比
查看>>
VS2010中使用ankhSVN
查看>>
C#使用 Salt + Hash 来为密码加密
查看>>
Visual Studio.net 配套开发工具
查看>>
WCF4 Rest Service及Entity Framework with POCO之旅
查看>>
部署在wcf rest服务上的wcf rest服务调用页面程序
查看>>
.Net remoting, Webservice,WCF基础
查看>>
WCF和webservice的区别
查看>>
说说WCF Rest
查看>>
WCF4.0 –- RESTful WCF Services (1) (入门)
查看>>