Exemplo n.º 1
0
        static void Main(string[] args)
        {
            var firstLineArgs = Console.ReadLine().Split();
            var fullName      = firstLineArgs[0] + " " + firstLineArgs[1];
            var address       = firstLineArgs[2];
            var town          = firstLineArgs[3];
            var firstTuple    = new Threeuple <string, string, string>(fullName, address, town);

            var secondLineArgs = Console.ReadLine().Split();

            var name         = secondLineArgs[0];
            var litersOfBeer = int.Parse(secondLineArgs[1]);
            var drunkOrNot   = secondLineArgs[2];

            var secondTuple = new Threeuple <string, int, bool>(name, litersOfBeer, drunkOrNot == "drunk" ? true : false);

            var thirdLineArgs = Console.ReadLine().Split();

            string accountName    = thirdLineArgs[0];
            double accountBalance = double.Parse(thirdLineArgs[1]);
            string bankName       = thirdLineArgs[2];

            var thirtTuple = new Threeuple <string, double, string>(accountName, accountBalance, bankName);

            Console.WriteLine(firstTuple);
            Console.WriteLine(secondTuple);
            Console.WriteLine(thirtTuple);
        }
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split();
            Threeuple <string, string, string> tuple1 =
                new Threeuple <string, string, string>(input[0] + " " + input[1], input[2], input[3]);

            Console.WriteLine(tuple1);

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

            Console.WriteLine(tuple2);

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

            Console.WriteLine(tuple3);
        }