Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace PalindromeIntigers
- {
- class Program
- {
- static void Main()
- {
- while (true)
- {
- string command = Console.ReadLine();
- string output = IfPalindromeInteger(command);
- if(output == command)
- {
- Console.WriteLine("true");
- }
- if(output != command && command != "END")
- {
- Console.WriteLine("false");
- }
- if (command == "END")
- {
- break;
- }
- }
- }
- public static string IfPalindromeInteger(string command)
- {
- string result = string.Empty;
- for (int i = command.Length-1; i >=0; i--)
- {
- char number = command[i];
- result += number;
- }
- return result;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement