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;
- class MultiverseCommunication
- {
- static void Main()
- {
- string thirtNumSys = Console.ReadLine();
- thirtNumSys = thirtNumSys.Replace(" ", string.Empty);
- thirtNumSys = thirtNumSys.ToUpper();
- string helpVar = string.Empty;
- long sum = 0;
- for (int i = 0, j = thirtNumSys.Length / 3 - 1; i < thirtNumSys.Length; i = i + 3, j--)
- {
- helpVar = thirtNumSys.Substring(i, 3);
- switch (helpVar)
- {
- case "CHU": sum += 0; ; break;
- case "TEL": sum += 1 * PowerOgThirteen(j); break;
- case "OFT": sum += 2 * PowerOgThirteen(j); break;
- case "IVA": sum += 3 * PowerOgThirteen(j); break;
- case "EMY": sum += 4 * PowerOgThirteen(j); break;
- case "VNB": sum += 5 * PowerOgThirteen(j); break;
- case "POQ": sum += 6 * PowerOgThirteen(j); break;
- case "ERI": sum += 7 * PowerOgThirteen(j); break;
- case "CAD": sum += 8 * PowerOgThirteen(j); break;
- case "K-A": sum += 9 * PowerOgThirteen(j); break;
- case "IIA": sum += 10 * PowerOgThirteen(j); break;
- case "YLO": sum += 11 * PowerOgThirteen(j); break;
- case "PLA": sum += 12 * PowerOgThirteen(j); break;
- default: ; break;
- }
- }
- Console.Write(sum);
- }
- static long PowerOgThirteen(int power)
- {
- long res = 1;
- for (int i = 0; i < power; i++)
- {
- res *= 13;
- }
- return res;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement