-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package 문자열; | ||
import java.io.*; | ||
import java.util.*; | ||
//6550번 부분 문자열 | ||
public class 부분_문자열 { | ||
public static void main(String[] args) throws IOException{ | ||
BufferedReader br= new BufferedReader(new InputStreamReader(System.in)); | ||
StringTokenizer st; | ||
String str, s, t; | ||
int idx; | ||
|
||
while (true) { | ||
str=br.readLine(); | ||
if (str==null) break; | ||
|
||
st= new StringTokenizer(str); | ||
s= st.nextToken(); | ||
t= st.nextToken(); | ||
|
||
idx=0; //초기화 | ||
for (int i=0;i<t.length();i++){ | ||
if (s.charAt(idx)==t.charAt(i)) idx++; | ||
if (idx==s.length()) break; | ||
} | ||
|
||
if (idx==s.length()) System.out.println("Yes"); | ||
else System.out.println("No"); | ||
} | ||
|
||
} | ||
|
||
} |