diff --git "a/zinnnn37/202509/26 BOJ G5 \353\254\270\354\236\220\354\227\264 \353\263\265\354\202\254.md" "b/zinnnn37/202509/26 BOJ G5 \353\254\270\354\236\220\354\227\264 \353\263\265\354\202\254.md" new file mode 100644 index 00000000..ef44b4a9 --- /dev/null +++ "b/zinnnn37/202509/26 BOJ G5 \353\254\270\354\236\220\354\227\264 \353\263\265\354\202\254.md" @@ -0,0 +1,40 @@ +```java +import java.io.*; + +public class BJ_2195_문자열_복사 { + + private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); + private static final BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); + + private static String needle, haystack; + + public static void main(String[] args) throws IOException { + sol(); + } + + private static void sol() throws IOException { + needle = br.readLine(); + haystack = br.readLine(); + + int cnt = 0; + int start = 0; + int len = haystack.length(); + while (start < len) { + int end = start + 1; + + while (end <= len && needle.indexOf(haystack.substring(start, end)) != -1) { + end++; + } + + start = end - 1; + cnt++; + } + + bw.write(cnt + "\n"); + bw.flush(); + bw.close(); + br.close(); + } + +} +``` \ No newline at end of file