Example #1
0
        static void Main(string[] args)
        {
            var nameAdressTown = Console.ReadLine().Split();
            var fullName       = nameAdressTown[0] + " " + nameAdressTown[1];
            var adress         = nameAdressTown[2];
            var town           = nameAdressTown[3];

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

            var  personBeerDrunk = Console.ReadLine().Split();
            var  person          = personBeerDrunk[0];
            var  beer            = int.Parse(personBeerDrunk[1]);
            bool drunk;

            drunk = personBeerDrunk[2] == "drunk";
            var secondThreeuple = new Threeuple <string, int, bool>(person, beer, drunk);

            var personCashBank = Console.ReadLine().Split();
            var name           = personCashBank[0];
            var cash           = double.Parse(personCashBank[1]);
            var bank           = personCashBank[2];
            var thirdThreeuple = new Threeuple <string, double, string>(name, cash, bank);

            Console.WriteLine(firstThreeuple);
            Console.WriteLine(secondThreeuple);
            Console.WriteLine(thirdThreeuple);
        }
Example #2
0
        public static void Main()
        {
            // First tuple
            string[] first = Console.ReadLine().Split();
            Threeuple<string, string, string> tuple1 = new Threeuple<string, string, string>(first[0] + " " + first[1], first[2], first[3]);

            // Second tuple
            string[] second = Console.ReadLine().Split();
            Threeuple<string, int, bool> tuple2 = new Threeuple<string, int, bool>(second[0], int.Parse(second[1]), (second[2] == "drunk"));

            // Third tuple
            string[] third = Console.ReadLine().Split();
            Threeuple<string, double, string> tuple3 = new Threeuple<string, double, string>(third[0], double.Parse(third[1]), third[2]);

            // Print tuples
            Console.WriteLine(tuple1.ToString());
            Console.WriteLine(tuple2);
            Console.WriteLine(tuple3);
        }