Josif_tepe

Untitled

Apr 25th, 2026
363
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2. #include <algorithm>
  3. using namespace std;
  4. int main(){
  5.   int n;
  6.   cin>>n;
  7.   string s,t;
  8.    int p=0;
  9.       int q=0;
  10.   for(int i=0; i<n; i++){
  11.       cin>>s>>t;
  12.       p=0;
  13.       q=0;
  14.   while(p<s.size() and q<t.size()){
  15.       if(s[p]==t[q]){
  16.           p++;
  17.           q++;
  18.       }
  19.       else{
  20.           q++;
  21.       }
  22.   }
  23.  
  24.   if(p==s.size()){
  25.       cout<<"DA" << endl;
  26.   }
  27.   else{
  28.       cout<<"NE" << endl;
  29.   }
  30.   }
  31.   return 0;
  32.   }
  33.  
  34.  
  35.  
Advertisement
Add Comment
Please, Sign In to add comment