Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Numerics;
- using System.Text;
- namespace exampreparation
- {
- class exam
- {
- static void Main(string[] args)
- {
- Palindrome();
- }
- static void Palindrome()
- {
- string command = Console.ReadLine();
- while (command != "END")
- {
- char[] input = command.ToArray();
- char[] newInput = input.Reverse().ToArray();
- string name = string.Join("", input);
- string name1 = string.Join("", newInput);
- if (name == name1)
- {
- Console.WriteLine("true");
- }
- else
- {
- Console.WriteLine("false");
- }
- command = Console.ReadLine();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement