공부기록/백준
[백준] 1543번 문서 검색
메델
2024. 1. 9. 09:05
import java.util.*;
public class Main
{
public static void main(String[] args) {
Scanner kb = new Scanner(System.in);
String document = kb.nextLine();
String word = kb.nextLine();
document = document.replaceAll(word, "*");
int count = 0;
for(char x: document.toCharArray()){
if(x== '*') count++;
}
System.out.println(count);
}
}