Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<stdio.h>
- #include<string.h>
- using namespace std;
- int main()
- {
- char str1[100],str2[100];
- int len1,len2;
- while(gets(str1),gets(str2))
- {
- len2=0;
- len1=strlen(str1);
- for(int i=len1-1; i>=0; i--)
- {
- if(str1[i]==str2[len2])
- {
- len2++;
- }
- else
- {
- break;
- }
- }
- if(len1==len2)
- {
- printf("YES\n");
- }
- else
- {
- printf("NO\n");
- }
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment