Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string slowo = Console.ReadLine();
- string slowo1 = slowo.ToUpper();
- char[] tablica = new char[slowo1.Length];
- char[] tablica1 = new char[slowo1.Length];
- for( int x = 0; x < slowo1.Length; x++)
- {
- tablica[x] = slowo1[x];
- }
- int k = 0;
- int c = slowo.Length;
- for (int xx = 1; xx <= c; --c)
- {
- tablica1[k] = slowo1[c-1];
- k++;
- }
- for (int g = 0; g < slowo.Length; g++)
- {
- if (tablica[g] == tablica1[g])
- {
- continue;
- }
- else
- {
- Console.WriteLine("Nie palindrom");
- break;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement