Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace ConsoleApp1
- {
- class Program
- {
- static int Reverse(int a)
- {
- int b = 0;
- int c = 1;
- int x;
- int d = a;
- while (d != 0)
- {
- x = d % 10;
- b = b * 10 + x;
- d /= 10;
- Console.WriteLine("x = " + x + " b = " + b + " d = " + d + " c = " + c);
- }
- return b;
- }
- static void Main(string[] args)
- {
- int a = int.Parse(Console.ReadLine());
- int a1 = Reverse(a);
- Console.WriteLine("reverse na a = " + a1);
- }
- }
- }
Add Comment
Please, Sign In to add comment