Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //переворачивание чисел
- int a,i, b, e;
- a = int.Parse(Console.ReadLine());
- b = -1;
- i = 1;
- e = 0;
- if (a < 1)
- {
- Console.WriteLine(0);
- }
- else
- {
- while (i <= a)
- {
- b++;
- i = i * 10;
- };
- i=i / 10;
- while (0<=b)
- {
- e = e + ((a % 10) * (i));
- a = a / 10;
- i = i / 10;
- b = b - 1;
- };
- Console.WriteLine(e);
- };
- Console.ReadLine();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement