Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class FancyNumber
- {
- static void Main()
- {
- string inputN = Console.ReadLine();
- int digCnt = inputN.Length;
- string[,] n = { {"", "0","00","000","01","1","10","100","1000","02"},
- {"", "2","22","222","23","3","32","322","3222","24"},
- {"", "4","44","444","45","5","54","544","5444","46"},
- {"", "6","66","666","67","7","76","766","7666","68"} };
- int digit=0;
- string fancyNum = "";
- for (int offset = digCnt; offset > 0; offset--)
- {
- digit=int.Parse(inputN.Substring(offset-1,1));
- for (int i = 1; i < 10;i++)
- {
- if (digit == i)
- {
- fancyNum = n[digCnt-offset, i]+fancyNum;
- break;
- }
- }
- }
- Console.WriteLine(fancyNum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment