SHARE
TWEET

Untitled

a guest Sep 21st, 2019 102 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //переворачивание чисел
  2. int a,i, b, e;
  3.             a = int.Parse(Console.ReadLine());
  4.             b = -1;
  5.             i = 1;
  6.             e = 0;
  7.             if (a < 1)
  8.             {
  9.                 Console.WriteLine(0);
  10.             }
  11.             else
  12.             {
  13.                 while (i <= a)
  14.                 {
  15.                     b++;
  16.                     i = i * 10;
  17.                 };
  18.                 i=i / 10;
  19.                 while (0<=b)
  20.                 {
  21.                     e = e + ((a % 10) * (i));
  22.                     a = a / 10;
  23.                     i = i / 10;
  24.                     b = b - 1;
  25.                 };
  26.                 Console.WriteLine(e);
  27.             };
  28.             Console.ReadLine();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top