HWOJ字符串匹配
作者:
Yuu_CX | 来源:发表于
2017-02-18 11:15 被阅读0次import java.util.*;
public class Main{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
boolean b = boolIsAllCharExist(sc.nextLine(),sc.nextLine());
System.out.println(b);
}
sc.close();
}
public static boolean boolIsAllCharExist(String s1, String s2){
boolean b = false;
char temp;
for(int i=0;i<s1.length();i++){
temp = s1.charAt(i);
for(int j=0;j<s2.length();j++){
if(temp==s2.charAt(j)){
b = true;
break;
}
}
if(!b) {
return false;
}
}
return true;
}
}
本文标题:HWOJ字符串匹配
本文链接:https://www.haomeiwen.com/subject/iwprwttx.html
网友评论