static void Main()
        {
            string[] firstLine = ParseInput();
            string   fullName  = $"{firstLine[0]} {firstLine[1]}";
            string   address   = firstLine[2];
            string   town      = firstLine[3];

            var firstThreeuple = new Threeuple <string, string, string>(fullName, address, town);

            Console.WriteLine(firstThreeuple);

            string[] secondLine = ParseInput();
            string   name       = secondLine[0];
            int      beerLiters = int.Parse(secondLine[1]);
            bool     isDrunk    = secondLine[2] == "drunk";

            var secondThreeuple = new Threeuple <string, int, bool>(name, beerLiters, isDrunk);

            Console.WriteLine(secondThreeuple);

            string[] thirdLine      = ParseInput();
            string   firstName      = thirdLine[0];
            double   accountBalance = double.Parse(thirdLine[1]);
            string   bankName       = thirdLine[2];

            var thirdThreeuple = new Threeuple <string, double, string>(firstName, accountBalance, bankName);

            Console.WriteLine(thirdThreeuple);
        }
Пример #2
0
        public static void Main()
        {
            string[] inputArgs = Console.ReadLine().Split();
            string   fullname  = $"{inputArgs[0]} {inputArgs[1]}";
            Threeuple <string, string, string> firstTuple = new Threeuple <string, string, string>(fullname, inputArgs[2], inputArgs[3]);

            inputArgs = Console.ReadLine().Split();
            Threeuple <string, int, bool> secondTuple = new Threeuple <string, int, bool>(inputArgs[0], int.Parse(inputArgs[1]), inputArgs[2] == "drunk" ? true : false);

            inputArgs = Console.ReadLine().Split();
            Threeuple <string, double, string> thirdTuple = new Threeuple <string, double, string>(inputArgs[0], double.Parse(inputArgs[1]), inputArgs[2]);

            Console.WriteLine(firstTuple);
            Console.WriteLine(secondTuple);
            Console.WriteLine(thirdTuple);
        }