Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. string slowo = Console.ReadLine();
  2.  
  3. string slowo1 = slowo.ToUpper();
  4.  
  5. char[] tablica = new char[slowo1.Length];
  6. char[] tablica1 = new char[slowo1.Length];
  7.  
  8.  
  9. for( int x = 0; x < slowo1.Length; x++)
  10. {
  11.  
  12. tablica[x] = slowo1[x];
  13.  
  14. }
  15. int k = 0;
  16. int c = slowo.Length;
  17.  
  18.  
  19.  
  20. for (int xx = 1; xx <= c; --c)
  21. {
  22.  
  23. tablica1[k] = slowo1[c-1];
  24. k++;
  25. }
  26.  
  27. for (int g = 0; g < slowo.Length; g++)
  28. {
  29.  
  30.  
  31. if (tablica[g] == tablica1[g])
  32. {
  33. continue;
  34. }
  35. else
  36. {
  37. Console.WriteLine("Nie palindrom");
  38. break;
  39. }
  40.  
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement