题解 | #字符串字符匹配#
字符串字符匹配
https://www.nowcoder.com/practice/22fdeb9610ef426f9505e3ab60164c93
import java.util.*; import java.util.stream.Stream; public class Main{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); String sho= sc.nextLine(); String lon = sc.nextLine(); int count=0; char[] array = sho.toCharArray(); for (char c : array) { if (lon.contains(String.valueOf(c))){ count++; } } if (count>=sho.length()){ System.out.println(true); }else { System.out.println(false); } } }