Find Your Solution Here

Codeforces

codeforces solution 41A – Translation

Problem link—41A – Translation
/*

Harun-or-Rashid

CSEDU-23rd Batch

*/

By coder_87, contest: Codeforces Beta Round #40 (Div. 2), problem: (A) Translation, Accepted, #


#include <bits/stdc++.h>

using namespace std;

int main()
{
    int l1,l2,i,cnt=0,j;
    char s1[105],s2[105];
    scanf("%s%s",s1,s2);
    l1=strlen(s1);
    l2=strlen(s2);
    for(i=0,j=l2-1; i<l1,j>=0; i++,j--)
    {
        if(s1[i]==s2[j])
        {
            cnt++;
        }
    }
    if(cnt==l1)
    {
        printf("YES\n");
    }
    else
    {
        printf("NO\n");
    }
    return 0;
}

Leave a Reply