Ejemplo n.º 1
0
        public static void Main()
        {
            var firstPair      = Console.ReadLine().Split(' ');
            var name           = $"{firstPair[0]} {firstPair[1]}";
            var address        = firstPair[2];
            var town           = firstPair[3];
            var firstThreeuple = new Threeuple <string, string, string>(name, address, town);

            var secondPair = Console.ReadLine().Split(' ');

            name = secondPair[0];
            var beerAmount      = int.Parse(secondPair[1]);
            var isDrunk         = secondPair[2] == "drunk" ? true : false;
            var secondThreeuple = new Threeuple <string, int, bool>(name, beerAmount, isDrunk);

            var thirdPair = Console.ReadLine().Split(' ');

            name = thirdPair[0];
            var doubleItem     = double.Parse(thirdPair[1]);
            var bankName       = thirdPair[2];
            var thirdThreeuple = new Threeuple <string, double, string>(name, doubleItem, bankName);

            Console.WriteLine(firstThreeuple);
            Console.WriteLine(secondThreeuple);
            Console.WriteLine(thirdThreeuple);
        }
        static void Main()
        {
            var firstLine = Console.ReadLine().Split();
            var firstName = firstLine[0] + " " + firstLine[1];
            var adress    = firstLine[2];
            var town      = firstLine[3];

            var firstTuple = new Threeuple <string, string, string>(firstName, adress, town);

            Console.WriteLine(firstTuple);

            var  secondLine     = Console.ReadLine().Split();
            var  secondLineName = secondLine[0];
            var  amountOfBeer   = int.Parse(secondLine[1]);
            bool drunk          = secondLine[2] == "drunk";

            var secondTuple = new Threeuple <string, int, bool>(secondLineName, amountOfBeer, drunk);

            Console.WriteLine(secondTuple);

            var thirdLine     = Console.ReadLine().Split();
            var thirdLineName = thirdLine[0];
            var balance       = double.Parse(thirdLine[1]);
            var bankName      = thirdLine[2];

            var thirdTuple = new Threeuple <string, double, string>(thirdLineName, balance, bankName);

            Console.WriteLine(thirdTuple);
        }
Ejemplo n.º 3
0
        public static void Main()
        {
            var input          = Console.ReadLine().Split(new [] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
            var name           = string.Concat(input[0], " ", input[1]);
            var address        = input[2];
            var town           = input[3];
            var firstThreeuple = new Threeuple <string, string, string>(name, address, town);

            Console.WriteLine(firstThreeuple);

            input = Console.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
            name  = input[0];
            var  litersOfBeer = int.Parse(input[1]);
            bool drunkOrNot   = true;

            if (input[2].ToLower() == "not")
            {
                drunkOrNot = false;
            }
            var secondThreeuple = new Threeuple <string, int, bool>(name, litersOfBeer, drunkOrNot);

            Console.WriteLine(secondThreeuple);

            input = Console.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
            name  = input[0];
            var accountbalance = double.Parse(input[1]);
            var bankName       = input[2];
            var thirdThreeuple = new Threeuple <string, double, string>(name, accountbalance, bankName);

            Console.WriteLine(thirdThreeuple);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            string[] firstInput = Console.ReadLine().Split();
            string   fullName   = $"{firstInput[0]} {firstInput[1]}";
            string   adress     = firstInput[2];
            string   town       = firstInput[3];
            Threeuple <string, string, string> firstTuple = new Threeuple <string, string, string>(fullName, adress, town);

            Console.WriteLine($"{firstTuple.Item1} -> {firstTuple.Item2} -> {firstTuple.Item3}");

            string[] secondInput  = Console.ReadLine().Split();
            string   name         = secondInput[0];
            double   amountOfBeer = double.Parse(secondInput[1]);
            bool     drinkOrNot;

            if (secondInput[2] == "drunk")
            {
                drinkOrNot = true;
            }
            else
            {
                drinkOrNot = false;
            }
            Threeuple <string, double, bool> secondThreuple = new Threeuple <string, double, bool>(name, amountOfBeer, drinkOrNot);

            Console.WriteLine($"{secondThreuple.Item1} -> {secondThreuple.Item2} -> {secondThreuple.Item3}");

            string[] thirdInput     = Console.ReadLine().Split();
            string   firtsStr       = thirdInput[0];
            double   accountBalance = double.Parse(thirdInput[1]);
            string   bankName       = thirdInput[2];
            Threeuple <string, double, string> thirdTulip = new Threeuple <string, double, string>(firtsStr, accountBalance, bankName);

            Console.WriteLine($"{thirdTulip.Item1} -> {thirdTulip.Item2} -> {thirdTulip.Item3}");
        }
Ejemplo n.º 5
0
        public static void Main()
        {
            string[] personInfo = Console.ReadLine().Split();

            string fullName = personInfo[0] + " " + personInfo[1];
            string adress   = personInfo[2];
            string town     = personInfo[3];

            string[] beerInfo = Console.ReadLine().Split();

            string name       = beerInfo[0];
            int    litters    = int.Parse(beerInfo[1]);
            bool   drunkOrNot = beerInfo[2] == "drunk"? true : false;

            string[] bankInfo = Console.ReadLine().Split();

            string nameAccount = bankInfo[0];
            double cash        = double.Parse(bankInfo[1]);
            string bankName    = bankInfo[2];

            Threeuple <string, string, string> personAdress = new Threeuple <string, string, string>(fullName, adress, town);
            Threeuple <string, int, bool>      beerLitters  = new Threeuple <string, int, bool>(name, litters, drunkOrNot);
            Threeuple <string, double, string> specialNums  = new Threeuple <string, double, string>(nameAccount, cash, bankName);

            Console.WriteLine(personAdress);
            Console.WriteLine(beerLitters);
            Console.WriteLine(specialNums);
        }
Ejemplo n.º 6
0
        static void Main(string[] args)
        {
            var    line1    = Console.ReadLine().Split();
            string fullName = line1[0] + " " + line1[1];
            string address  = line1[2];
            string town     = line1[3];
            var    tuple1   = new Threeuple <string, string, string>(fullName, address, town);


            var    line2 = Console.ReadLine().Split();
            string name  = line2[0];
            int    beers = int.Parse(line2[1]);
            string mood  = line2[2];

            if (mood == "drunk")
            {
                mood = "True";
            }

            else
            {
                mood = "False";
            }
            var tuple2 = new Threeuple <string, int, string>(name, beers, mood);

            var    line3       = Console.ReadLine().Split();
            string name_       = line3[0];
            double bankAccount = double.Parse(line3[1]);
            string bankName    = line3[2];
            var    tuple3      = new Threeuple <string, double, string>(name_, bankAccount, bankName);

            Console.WriteLine(tuple1.ToString());
            Console.WriteLine(tuple2.ToString());
            Console.WriteLine(tuple3.ToString());
        }
Ejemplo n.º 7
0
        public static void Main(string[] args)
        {
            string[] firstLastAdress = Console.ReadLine().Split();
            string   firstName       = firstLastAdress[0];
            string   lastName        = firstLastAdress[1];
            string   address         = firstLastAdress[2];
            string   town            = firstLastAdress[3];
            string   name            = firstName + " " + lastName;

            var firstTuple = new Threeuple <string, string, string>(name, address, town);

            Console.WriteLine(firstTuple);


            string[] secondLine     = Console.ReadLine().Split();
            string   nameSecondLine = secondLine[0];
            int      amountOfBeer   = int.Parse(secondLine[1]);
            string   drunkOrNot     = secondLine[2];

            bool isDrunk = drunkOrNot == "drunk";

            var secondTuple = new Threeuple <string, int, bool>(nameSecondLine, amountOfBeer, isDrunk);

            Console.WriteLine(secondTuple);

            string[] thirdLine      = Console.ReadLine().Split();
            string   nameThirdLine  = thirdLine[0];
            double   accountBalance = double.Parse(thirdLine[1]);
            string   bank           = thirdLine[2];

            var thirdTuple = new Threeuple <string, double, string>(nameThirdLine, accountBalance, bank);

            Console.WriteLine(thirdTuple);
        }
        static void Main()
        {
            // Enter the first line
            string[] tokens   = EnterData();
            string   fullName = tokens[0] + " " + tokens[1];
            string   address  = tokens[2];
            string   town     = tokens[3];

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

            Console.WriteLine(threeuple1);

            // Enter the second line
            tokens = EnterData();
            string name         = tokens[0];
            int    litersOfBeer = int.Parse(tokens[1]);
            bool   isDrunk      = tokens[2] == "drunk" ? true : false;

            var threeuple2 = new Threeuple <string, int, bool>(name, litersOfBeer, isDrunk);

            Console.WriteLine(threeuple2);

            // Enter the third line
            tokens = EnterData();
            string personName = tokens[0];
            double balance    = double.Parse(tokens[1]);
            string bankName   = tokens[2];

            var threeuple3 = new Threeuple <string, double, string>(personName, balance, bankName);

            Console.WriteLine(threeuple3);
        }
Ejemplo n.º 9
0
        static void Main(string[] args)
        {
            string[] nameAdressTown = Console.ReadLine().Split();
            string   fullName       = nameAdressTown[0] + " " + nameAdressTown[1];
            string   adress         = nameAdressTown[2];
            string   town           = nameAdressTown[3];

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

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

            if (personBeerDrunk[2] == "drunk")
            {
                drunk = true;
            }
            else
            {
                drunk = false;
            }
            Threeuple <string, int, bool> secondThreeuple = new Threeuple <string, int, bool>(person, beer, drunk);

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

            Console.WriteLine(firstThreeuple);
            Console.WriteLine(secondThreeuple);
            Console.WriteLine(thirdThreeuple);
        }
Ejemplo n.º 10
0
        static void Main(string[] args)
        {
            var line1    = Console.ReadLine().Split();
            var fullName = line1[0] + " " + line1[1];
            var address  = line1[2];
            var town     = line1[3];
            var tuple1   = new Threeuple <string, string, string>(fullName, address, town);

            Console.WriteLine(tuple1);

            var line2        = Console.ReadLine().Split();
            var name1        = line2[0];
            var litersOfBeer = int.Parse(line2[1]);
            var drunkOrNot   = line2[2] == "drunk";
            var tuple2       = new Threeuple <string, int, bool>(name1, litersOfBeer, drunkOrNot);

            Console.WriteLine(tuple2);

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

            Console.WriteLine(tuple3);
        }
Ejemplo n.º 11
0
        private static Threeuple <string, double, string> ThirdThreeuple()
        {
            var line           = Console.ReadLine().Split().ToArray();
            var name           = line[0];
            var accountBalance = double.Parse(line[1]);
            var bankName       = line[2];

            Threeuple <string, double, string> bankInfo = new Threeuple <string, double, string>(name, accountBalance, bankName);

            return(bankInfo);
        }
Ejemplo n.º 12
0
        private static Threeuple <string, string, string> FirstThreeuple()
        {
            var personInfo = Console.ReadLine().Split().ToArray();
            var firstName  = personInfo[0];
            var lastName   = personInfo[1];
            var address    = personInfo[2];
            var town       = personInfo[3];

            var fullName = firstName + " " + lastName;
            Threeuple <string, string, string> person = new Threeuple <string, string, string>(fullName, address, town);

            return(person);
        }
Ejemplo n.º 13
0
        private static Threeuple <string, int, bool> SecondThreeuple()
        {
            var line           = Console.ReadLine().Split().ToArray();
            var name           = line[0];
            var beer           = int.Parse(line[1]);
            var drinkOrNotInfo = line[2];

            bool drinkOrNot = false;

            if (drinkOrNotInfo == "drunk")
            {
                drinkOrNot = true;
            }

            Threeuple <string, int, bool> drinks = new Threeuple <string, int, bool>(name, beer, drinkOrNot);

            return(drinks);
        }
Ejemplo n.º 14
0
        public static void Main()
        {
            string[] firstPair = Console.ReadLine().Split(' ');
            string   name      = $"{firstPair[0]} {firstPair[1]}";
            string   address   = firstPair[2];
            string   town      = firstPair[3];
            Threeuple <string, string, string> firstThreeuple = new Threeuple <string, string, string>(name, address, town);

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

            string[] thirdPair = Console.ReadLine().Split(' ');
            name = thirdPair[0];
            double doubleItem = double.Parse(thirdPair[1]);
            string bankName   = thirdPair[2];
            Threeuple <string, double, string> thirdThreeuple = new Threeuple <string, double, string>(name, doubleItem, bankName);

            Console.WriteLine(firstThreeuple);
            Console.WriteLine(secondThreeuple);
            Console.WriteLine(thirdThreeuple);
        }