/*题目:输入:一个文件,一个特征字符串 输出:这个特征字符串在文件中出现的次数**/import java.util.*;public class face1{public static void main(String[] args){Scanner scan = new Scanner(System.in);String str1= scan.nextLine();String str2= scan.nextLine();int count = 0;String temp= new String();temp = str1.replaceAll(str2,"");count =( str1.length()-temp.length())/str2.length();System.out.println(count);}}
笔试题1
最新推荐文章于 2024-08-19 16:01:20 发布