题解 | #字符串字符匹配#

字符串字符匹配

http://www.nowcoder.com/practice/22fdeb9610ef426f9505e3ab60164c93

import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        
        String s1=sc.nextLine();
        String s2=sc.nextLine();
        
        String t;
        for(char ch:s1.toCharArray()){
            t=ch+"";
            if(!s2.contains(t)){
                System.out.println(false);
                return;
            }
        }
        System.out.println(true);
    }
}

全部评论

相关推荐

阿武同学:不要写至今,写具体哪年哪月毕业,专业技能往后排,项目往前排,共青团员可以不写
投了多少份简历才上岸
点赞 评论 收藏
分享
不愿透露姓名的神秘牛友
09-10 14:32
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务