Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Numerics;
- namespace podgotovka1vazada4a
- {
- class Program
- {
- static BigInteger MeowToDec(string meow)
- {
- BigInteger sum = 0;
- foreach (char digit in meow)
- {
- sum = (digit - 'a') + sum * 21;
- }
- return sum;
- }
- static string DecimalToMeow(BigInteger decValue)
- {
- string result = string.Empty;
- do
- {
- char digit = (char)('a' + (decValue % 26));
- result = digit + result;
- decValue /= 26;
- } while (decValue > 0);
- return result;
- }
- static void Main(string[] args)
- {
- var input = Console.ReadLine().Split(' ').Select(MeowToDec).ToArray();
- foreach (var word in input)
- {
- var asnwer = DecimalToMeow(word);
- Console.Write(asnwer + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement