Advertisement
Spocoman

09. Palindrome Integers

Jan 26th, 2022 (edited)
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.54 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace PalindromeIntegers
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             string input;
  11.  
  12.             while ((input = Console.ReadLine()) != "END")
  13.             {
  14.                 Console.WriteLine(PalindromeChecker(input));
  15.             }
  16.         }
  17.         static bool PalindromeChecker(string str)
  18.         {
  19.             char[] rev = str.ToCharArray();
  20.             Array.Reverse(rev);
  21.  
  22.             return str.Equals(new string(rev));
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement