Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace Numerology
- {
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- class Numerology
- {
- static void Main()
- {
- string date = Console.ReadLine();
- string name = Console.ReadLine();
- string newName = string.Empty;
- for (int i = 0; i < name.Length; i++)
- {
- newName += name[i] + " ";
- }
- List<string> nameList = newName.Split(' ').ToList();
- List<string> sum = date.Split('.').ToList();
- long multipy = 1;
- foreach (var item in sum)
- {
- multipy *= long.Parse(item);
- }
- long anotherMultiply = 1;
- if (long.Parse(sum[1]) % 2 != 0)
- {
- anotherMultiply = multipy * multipy;
- multipy = anotherMultiply;
- }
- var alphabet = new List<string>() { "#", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k",
- "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
- var upAlphabet = new List<string>() { "#", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K",
- "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };
- var numbers = new List<string>() { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" };
- for (int i = 0; i < nameList.Count; i++)
- {
- if (alphabet.Contains(nameList[i]))
- {
- multipy += alphabet.IndexOf(nameList[i]);
- }
- else if(upAlphabet.Contains(nameList[i]))
- {
- multipy += upAlphabet.IndexOf(nameList[i]) * 2;
- }
- else if (numbers.Contains(nameList[i]))
- {
- multipy += numbers.IndexOf(nameList[i]);
- }
- }
- long result = 0;
- while (multipy > 13)
- {
- result = multipy.ToString().Sum(c => c - '0');
- multipy = result;
- }
- Console.WriteLine(result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement