Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int test_case;
- cin >> test_case;
- for(int T = 0; T < test_case; T += 1) {
- string Ti;
- string Si;
- int x=0;
- int k=0;
- cin>>Ti;
- cin>>Si;
- int p;
- p=Ti.size();
- int u;
- u=Si.size();
- if(p>u){
- cout<<"NE" << endl;
- }
- if((Ti==Si)and(p==u)){
- cout<<"DA" << endl;
- }
- if((Ti!=Si) and (p==u)){
- cout<<"NE" << endl;
- }
- if(p<u){
- for(int i=0; i<p; i+=1){
- while(x<u){
- if(Ti[i]==Si[x]){
- k+=1;
- x+=1;
- break;
- }
- x+=1;
- }
- }
- if(k==p){
- cout<<"DA" << endl;
- }
- else {
- cout << "NE" << endl;
- }
- }
- }
- return 0;
- }
- /*
- if size of Si > size of Ti -> NO
- if size of Si == size of Ti -> check if they're equal
- Si Ti
- poraka phorXazkhYhWa
- i j
- */
Advertisement
Add Comment
Please, Sign In to add comment