Advertisement
Josif_tepe

Untitled

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