Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- using System.Numerics;
- class Program
- {
- static void Main()
- {
- StringBuilder read = new StringBuilder();
- string gagNum = Console.ReadLine();
- int local;
- List<int> final = new List<int>();
- int index = 1;
- read.Append(gagNum[0]);
- while (index < gagNum.Length)
- {
- read.Append(gagNum[index]);
- local = GetValue(read.ToString());
- if (local >= 0)
- {
- final.Add(local);
- read.Clear();
- }
- index++;
- }
- BigInteger sum = 0;
- for (int i = final.Count - 1, p = 0; i >= 0; i--, p++)
- {
- sum += final[i] * (BigInteger)Math.Pow(9, p);
- }
- Console.WriteLine(sum);
- }
- static int GetValue(string gagString)
- {
- string[] values = { "-!", "**", "!!!", "&&", "&-", "!-", "*!!!", "&*!", "!!**!-" };
- for (int i = 0; i < values.Length; i++)
- {
- if (gagString == values[i])
- {
- return i;
- }
- }
- return -1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement