Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class TripleRotation
- {
- static void Main()
- {
- int rotN = int.Parse(Console.ReadLine());
- string n=Convert.ToString(rotN);
- int nl=n.Length;
- string outN="";
- for (int i = 0; i < 3; i++)
- {
- outN = n.Substring(nl - 1, 1);
- outN = outN + n.Substring(0, nl - 1);
- if (outN.Substring(0,1) == "0")
- {
- nl -= 1;
- outN = outN.Substring(1,nl);
- }
- n = outN;
- }
- Console.WriteLine(outN);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment