Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main()
  6. {
  7. int x = int.Parse(Console.ReadLine());
  8. int y = int.Parse(Console.ReadLine());
  9.  
  10. if(reverseNumber(y) == x){
  11. Console.WriteLine("tak");
  12. } else {
  13. Console.WriteLine("nie");
  14. }
  15.  
  16. Console.ReadKey();
  17. }
  18.  
  19. static int reverseNumber(int number){
  20. char[] arr = number.ToString().ToCharArray();
  21. Array.Reverse(arr);
  22. return int.Parse(new string(arr));
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement