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;
- namespace ConsoleApplication4
- {
- class Program
- {
- static void Main(string[] args)
- {
- var lolkek = new[] { "AB", "AE", "AF", "BF", "EF", "BE", "BC", "FC", "FD", "CD" };
- var azazaz = new[] { 'A','B','C','D','E','F'};
- var dictionary = new Dictionary<char, int>();
- foreach (var bukva in azazaz)
- {
- dictionary.Add(bukva,0);
- }
- dictionary['A'] = 1;
- for (int i = 0; i < lolkek.Length; i++)
- {
- foreach (var bukva in azazaz)
- {
- if (bukva == lolkek[i][0])
- {
- //dictionary[bukva]++;
- dictionary[lolkek[i][1]] += dictionary[bukva];
- }
- }
- }
- Console.WriteLine(dictionary['D']);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement