Advertisement
Guest User

Untitled

a guest
Feb 17th, 2020
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include<iostream>
  2. #include<string.h>
  3. using namespace std;
  4. int main()
  5. {int n,i,j,ok,aux=0;
  6. char x[20], a[20];
  7. cin>>n;
  8. cin>>x; //primul cuvant
  9. while(n>1)
  10. {cin>>a;
  11. ok=0;
  12. j=strlen(x)-1;
  13. for(i=strlen(a)-1; i>=0;i--)
  14. {if(x[j]==a[i])
  15. ok++;
  16. j--;}
  17. if(ok==strlen(x))
  18. aux++;
  19. n--;}
  20. cout<<aux;}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement