raisul82

problemK

Nov 12th, 2016
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #include<iostream>
  2. #include<stdio.h>
  3. #include<string.h>
  4. using namespace std;
  5. int main()
  6. {
  7. char str1[100],str2[100];
  8. int len1,len2;
  9. while(gets(str1),gets(str2))
  10. {
  11. len2=0;
  12. len1=strlen(str1);
  13. for(int i=len1-1; i>=0; i--)
  14. {
  15. if(str1[i]==str2[len2])
  16. {
  17. len2++;
  18. }
  19. else
  20. {
  21. break;
  22. }
  23. }
  24. if(len1==len2)
  25. {
  26. printf("YES\n");
  27. }
  28. else
  29. {
  30. printf("NO\n");
  31. }
  32.  
  33. }
  34.  
  35. return 0;
  36.  
  37. }
Add Comment
Please, Sign In to add comment