Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Dva středníky za sebou neberu jako chybu
- // Vstup je nutno ale převést na malá resp. velká písmena
- // aby prošla i "Mom"
- //string input = Console.ReadLine(); ;
- string input = Console.ReadLine().ToLower();
- // palindrom s Y neberu jako chybu
- bool palyndrom = true;
- for (int x = 0; x < input.Length / 2; x++)
- {
- if (input[x] != input[input.Length - x - 1])
- {
- palyndrom = false;
- break;
- }
- }
- if (palyndrom) Console.WriteLine(input + " je palyndrom");
- else Console.WriteLine(input + " neni palyndrom");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement