Main02.java 428 B

123456789101112131415
  1. import java.util.Scanner;
  2. public class Main02 {
  3. public static void main(String[] args) {
  4. Scanner scanner = new Scanner(System.in);
  5. String str1 = scanner.nextLine().toLowerCase();
  6. String str2 = scanner.next().toLowerCase();
  7. int index = -1;
  8. int res = 0;
  9. while ((index = str1.indexOf(str2, index+1)) >= 0) {
  10. res++;
  11. }
  12. System.out.println(res);
  13. }
  14. }