A - Translation
Problem Link: [Codeforces 41A##link##]
- [tab]
- C++
#include<stdio.h> #include<string.h> int main() { char s[101],t[101],u[101]; gets(s); gets(t); strcpy(u,strrev(s)); if(strcmp(t,u)==0) printf("YES"); else printf("NO"); return(0); }
- Python3
def translation(word, wordr): if word[::-1] != wordr: return 'NO' else: return 'YES' a = input() b = input() print(translation(a, b))
- JAVA
import java.util.*; public class Main { public static void main(String[] args) { Scanner Leer = new Scanner(System.in); String p1 = Leer.next(); String p2 = Leer.next(); String c = ""; for (int i = p2.length()-1; i>=0 ; i--) { c += p2.charAt(i); } if (p1.equals(c)) { System.out.println("YES"); }else{ System.out.println("NO"); } } }