Advertisement
aryobarzan

Codeforces 40-A

Mar 28th, 2011
2,360
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 KB | None | 0 0
  1. using System;
  2. namespace Iran
  3. {
  4.         class Amir
  5.         {
  6.                 public static void Main()
  7.                 {
  8.                         string a=Console.ReadLine();
  9.                         string b=Console.ReadLine();
  10.                         bool ok=true;
  11.                         if(a.Length!=b.Length)
  12.                                 ok=false;
  13.                         for(int i=0;ok&&i<a.Length;++i)
  14.                         {
  15.                                 if(a[i]!=b[a.Length-i-1])
  16.                                 {
  17.                                         ok=false;
  18.                                         break;
  19.                                 }
  20.                         }
  21.                         if(ok)
  22.                                 Console.WriteLine("YES");
  23.                         else
  24.                                 Console.WriteLine("NO");
  25.                 }
  26.         }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement