【十二题解】 | #字符串字符匹配#
字符串字符匹配
http://www.nowcoder.com/practice/22fdeb9610ef426f9505e3ab60164c93
#include<stdio.h>
int main(){
char shrt;
char log;
while(scanf("%c", &shrt) != EOF){
int sign = 1;
log = '\0';
int st[128]={0};
int lo[128]={0};
st[shrt] = 1;
while(shrt != '\n'){
scanf("%c", &shrt);
st[shrt] = 1;
}
while(log != '\n'){
scanf("%c", &log);
lo[log] = 1;
}
for(int i=11; i<128; i++){
if(st[i]==1 && lo[i]==0){
sign =0;
break;
}
}
if(sign==1){
printf("true\n");
}
else{
printf("false\n");
}
}
}