BorislavBorisov

20.Triple Rotation

Sep 29th, 2015
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.46 KB | None | 0 0
  1. using System;
  2. class TripleRotation
  3. {
  4.     static void Main()
  5.     {
  6.         int number = int.Parse(Console.ReadLine());
  7.         for (int i = 0; i < 3; i++)
  8.         {
  9.             if(number > 9)
  10.             {
  11.                 int lastDigit = number % 10;
  12.                 number /= 10;
  13.                 string str = lastDigit.ToString() + number.ToString();
  14.                 number = int.Parse(str);
  15.             }
  16.         }
  17.         Console.WriteLine(number);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment