Пример #1
0
    static void M2()
    {
        string sLines  = Console.ReadLine();
        bool   bManual = sLines.StartsWith("m");

        if (bManual)
        {
            sLines = sLines.Substring(1);
        }
        int N = int.Parse(sLines);

        for (int i = 0; i < N; i++)
        {
            NumberSets o = new NumberSets();

            string s = Console.ReadLine();

            string sOut = o.Process(s);
            Console.WriteLine("Case #{0}: {1}", i + 1, sOut);


            //string[] sOut = o.ProcessMulti(roads,city);
            //Console.WriteLine("Case #{0}:", i + 1);
            //for (int j = 0; j < sOut.Length; j++) {
            //    Console.WriteLine(sOut[j]);
            //}
        }

        if (bManual)
        {
            Console.ReadKey();
        }
    }
Пример #2
0
 private void Validate()
 {
     if (Resources.Where(r => r.Type != ResourceType.Dessert).Sum(r => r.Amount) != NumberSets.Sum(n => n.Amount))
     {
         throw new ArgumentException("Rules invalid: The amount of resources must match the amount of numbers");
     }
 }