Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <algorithm>
- using namespace std;
- int main(){
- int n;
- cin>>n;
- string s,t;
- int p=0;
- int q=0;
- for(int i=0; i<n; i++){
- cin>>s>>t;
- p=0;
- q=0;
- while(p<s.size() and q<t.size()){
- if(s[p]==t[q]){
- p++;
- q++;
- }
- else{
- q++;
- }
- }
- if(p==s.size()){
- cout<<"DA" << endl;
- }
- else{
- cout<<"NE" << endl;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment