Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- string si, ti;
- int x, z, m, n, i, j, q;
- cin >> x;
- int niza[100]={0}, y[100]={0};
- for(i=0; x>i; i++){
- cin >> si >> ti;
- y[i] = si.length();
- z = ti.length();
- n = 0;
- m = 0;
- q = 0;
- for(j=0; j<y[i]; j++){
- for(q=n; q<z; q++){
- if(si[j]==ti[q]){
- m++;
- n = q+1;
- niza[i] = m;
- break;
- }
- }
- }
- }
- for(int a=0; x>a; a++){
- if(niza[a]==y[a])cout << "DA" << endl;
- else cout << "NE" << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment