-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUva10340.java
More file actions
25 lines (25 loc) · 897 Bytes
/
Uva10340.java
File metadata and controls
25 lines (25 loc) · 897 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.util.*;
import java.io.*;
public class Uva10340 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pr = new PrintWriter(System.out);
StringBuilder sb = new StringBuilder();
while(br.ready()){
boolean status = true ;
StringTokenizer st = new StringTokenizer(br.readLine());
String s1 = st.nextToken();
String s2 = st.nextToken();
int i1 = 0 ,i2 = 0 ;
while(i1<s1.length() && i2<s2.length()) {
if (s1.charAt(i1) == s2.charAt(i2)) i1++;
i2++;
}
if(i1 != s1.length()) status = false ;
sb.append( status ? "Yes\n" :"No\n" );
}
pr.print(sb.toString());
pr.close();
br.close();
}
}