Codeforces Beta Round #40 (Div. 2), problem: (A) Translation editorial: http://codeforces.com/blog/entry/1620
Codeforces Beta Round #40 (Div. 2), problem: (A) Translation solution: http://ideone.com/8gjthQ
#include <iostream> #include <cstdio> #include <cstring> using namespace std; int main() { int flag=0; char s[105], a[105], b[105]; scanf("%s%s", s, a); for(int i=strlen(a)-1, j=0; i>=0; i--, j++) b[j]=a[i]; for(int i=0; i<strlen(s); i++) if(b[i]!=s[i]) { flag=1; break; } if(flag==0) printf("YES"); else printf("NO"); return 0; }
No comments:
Post a Comment