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

字符串字符匹配

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

public class Main {
     public static void main(String[] args){
         Scanner sc = new Scanner(System.in);
         if(sc.hasNext()){
             String str = sc.nextLine();
             String strLong=sc.nextLine();
             char[] strChar=str.toCharArray();
             char[] LongChar=strLong.toCharArray();
             int count=0;
             for(char c:strChar){
                 for(char c1:LongChar){
                     if(c==c1){
                         count++;
                         break;
                     }
                 }
             }
             if(count==str.length()){
                 System.out.print(true);
             }else{
                 System.out.print(false);
             }
         }
     }
}
全部评论

相关推荐

但听说转正率很低,我现在有在实习了,好纠结要不要去
熬夜脱发码农:转正率低归低,但是实习的经历你可以拿着,又不是说秋招不准备了
点赞 评论 收藏
分享
头顶尖尖的程序员:我是26届的不太懂,25届不应该是找的正式工作吗?为什么还在找实习?大四还实习的话是为了能转正的的岗位吗
点赞 评论 收藏
分享
06-12 16:23
已编辑
小米_软件开发(准入职员工)
点赞 评论 收藏
分享
07-02 10:44
门头沟学院 C++
码农索隆:太实诚了,告诉hr,你能实习至少6个月
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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