문제: https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV14P0c6AAUCFAYi
package project;
import java.util.*;
public class Main {
static Scanner sc = new Scanner(System.in);
public static void Solved(){
String sentence = sc.nextLine();
String findSentence = sc.nextLine();
int count = 0;
for(int i=0; i<sentence.length(); i++){
if(sentence.indexOf(findSentence,i)>=0){
i = sentence.indexOf(findSentence,i);
count++;
}
}
System.out.println("count"+count);
}
public static void main(String args[]) {
int TestCount = sc.nextInt();
for(int i = 0; i < TestCount; i++){
Solved();
}
}
}