示例#1
0
        public static void Main()
        {
            string[] line1    = Console.ReadLine().Split();
            string   fullName = line1[0] + " " + line1[1];
            string   address  = line1[2];
            string   town     = line1[3];

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

            string[] line2 = Console.ReadLine().Split();
            string   name  = line2[0];
            int      beer  = int.Parse(line2[1]);
            bool     drunk = false;

            if (line2[2] == "drunk")
            {
                drunk = true;
            }

            var second = new Threeuple <string, int, bool>(name, beer, drunk);

            string[] line3        = Console.ReadLine().Split();
            string   secondName   = line3[0];
            double   doubleNumber = double.Parse(line3[1]);
            string   bankName     = line3[2];

            var third = new Threeuple <string, double, string>(secondName, doubleNumber, bankName);

            Console.WriteLine(first);
            Console.WriteLine(second);
            Console.WriteLine(third);
        }
        static void Main(string[] args)
        {
            var firstLine     = Console.ReadLine().Split(' ').ToArray();
            var FirstPlusLast = new string(firstLine[0] + " " + firstLine[1]);
            var address       = firstLine[2];
            var town1         = firstLine[3];
            var town          = town1;

            if (firstLine.Length - 1 > 3)
            {
                var town2 = firstLine[4];
                town = town1 + " " + town2;
            }

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

            var secondLine   = Console.ReadLine().Split(' ').ToArray();
            var name         = secondLine[0];
            var litersOfBeer = int.Parse(secondLine[1]);
            var drunkOrNot   = secondLine[2] == "drunk" ? "True" : "False";

            Threeuple <string, int, string> secondThreeuple = new Threeuple <string, int, string>(name, litersOfBeer, drunkOrNot);

            var thirdLine      = Console.ReadLine().Split(' ').ToArray();
            var name2          = thirdLine[0];
            var accountBalance = double.Parse(thirdLine[1]);
            var bankName       = thirdLine[2];
            Threeuple <string, double, string> thirdThreeuple = new Threeuple <string, double, string>(name2, accountBalance, bankName);

            Console.WriteLine(firstThreeuple);
            Console.WriteLine(secondThreeuple);
            Console.WriteLine(thirdThreeuple);
        }
        static void Main(string[] args)
        {
            var    input      = Console.ReadLine().Split();
            string name       = $"{input[0]} {input[1]}";
            string address    = input[2];
            string town       = input[3];
            var    firstTuple = new Threeuple <string, string, string>(name, address, town);

            Console.WriteLine(firstTuple);

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

            Console.WriteLine(secondTuple);

            input = Console.ReadLine().Split();
            name  = input[0];
            double bankBalance = double.Parse(input[1]);
            string bankName    = input[2];
            var    thirdTuple  = new Threeuple <string, double, string>(name, bankBalance, bankName);

            Console.WriteLine(thirdTuple);
        }
示例#4
0
        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);
        }
示例#5
0
        static void Main(string[] args)
        {
            // {first name} {last name} {address} {town}
            string[] nameArgs = Console.ReadLine().Split();
            string   name     = nameArgs[0] + " " + nameArgs[1];
            string   adress   = nameArgs[2];
            string   town     = "";

            for (int i = 3; i < nameArgs.Length; i++)
            {
                town += nameArgs[i] + " ";
            }

            var tuple1 = new Threeuple <string, string, string>(name, adress, town);

            // {name} {liters of beer} {drunk or not}
            string[] beerArgs   = Console.ReadLine().Split();
            string   nameTwo    = beerArgs[0];
            int      beer       = int.Parse(beerArgs[1]);
            string   drunkOrNot = beerArgs[2];
            bool     doDrink    = false;

            if (drunkOrNot == "drunk")
            {
                doDrink = true;
            }

            var tuple2 = new Threeuple <string, int, bool>(nameTwo, beer, doDrink);

            // {name} {account balance} {bank name}
            string[] bankArgs  = Console.ReadLine().Split();
            string   nameThree = bankArgs[0];
            double   balance   = double.Parse(bankArgs[1]);
            string   bankName  = bankArgs[2];

            var tuple3 = new Threeuple <string, double, string>(nameThree, balance, bankName);

            Console.WriteLine(tuple1);
            Console.WriteLine(tuple2);
            Console.WriteLine(tuple3);
        }