CCF-201409-3
我们先来看一下题目怎么说
同学们看完题目就要说我了,你好蔡哦!
题目确实不难,主要是介绍一个find()和tolower()和toupper()函数
代码
#include<iostream>
#include<cstring>
using namespace std;
string lower(string str){
string temp="";
for(int i=0;i<str.length();i++){
temp+=tolower(str[i]);
}
return temp;
}
int main(){
string str;
int flag,n;
cin>>str>>flag>>n;
while(n--){
string temp;
cin>>temp;
if(flag==1){
if(temp.find(str)!=str.npos){
cout<<temp<<endl;
}
}else{
string s1,s2;
s1=lower(str);
s2=lower(temp);
if(s2.find(s1)!=s1.npos){
cout<<temp<<endl;
}
}
}
return 0;
}