예제 #1
0
        static void Main(string[] args)
        {
            string[] input1  = Console.ReadLine().Split();
            string   name1   = input1[0] + " " + input1[1];
            string   country = input1[2];
            string   town    = input1[3] + " " + string.Join(" ", input1.Skip(4));

            Threeuple <string, string, string> myTuple1 = new Threeuple <string, string, string>(name1, country, town);

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

            string[] input3   = Console.ReadLine().Split();
            string   name3    = input3[0];
            double   liters   = double.Parse(input3[1]);
            string   bankName = input3[2];
            Threeuple <string, double, string> myTuple3 = new Threeuple <string, double, string>(name3, liters, bankName);

            Console.WriteLine(myTuple1);
            Console.WriteLine(myTuple2);
            Console.WriteLine(myTuple3);
        }
예제 #2
0
        static void Main(string[] args)
        {
            string[] tokens = Console.ReadLine()
                              .Split();
            string fullName = tokens[0] + " " + tokens[1];
            string adress   = tokens[2];
            string town     = string.Join(" ", tokens.Skip(3));

            tokens = Console.ReadLine()
                     .Split();
            string name         = tokens[0];
            int    litersOfBeer = int.Parse(tokens[1]);
            bool   drunkOrNot   = tokens[2] == "drunk"?true:false;

            tokens = Console.ReadLine()
                     .Split();
            string nameOfPersonBank = tokens[0];
            double acountBalance    = double.Parse(tokens[1]);
            string bankname         = tokens[2];

            var threeuple1 = new Threeuple <string, string, string>(fullName, adress, town);
            var threeuple2 = new Threeuple <string, int, bool>(name, litersOfBeer, drunkOrNot);
            var threeuple3 = new Threeuple <string, double, string>(nameOfPersonBank, acountBalance, bankname);

            Console.WriteLine(threeuple1.ToString());
            Console.WriteLine(threeuple2.ToString());
            Console.WriteLine(threeuple3.ToString());
        }
예제 #3
0
        static void Main(string[] args)
        {
            string[] inputPersonInfo = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries);

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

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

            string fulName = inputPersonInfo[0] + ' ' + inputPersonInfo[1];
            string adres   = inputPersonInfo[2];
            string town    = inputPersonInfo[3];


            string name   = inputBeer[0];
            int    liters = int.Parse(inputBeer[1]);
            string type   = inputBeer[2];

            bool isDrunk = type == "drunk" ? true : false;

            string personName = inputBankInfo[0];
            double balance    = double.Parse(inputBankInfo[1]);
            string bankName   = inputBankInfo[2];

            var personInfo = new Threeuple <string, string, string>(fulName, adres, town);

            var beerInfo = new Threeuple <string, int, bool>(name, liters, isDrunk);

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

            Console.WriteLine(personInfo);
            Console.WriteLine(beerInfo);
            Console.WriteLine(bankInfo);
        }
예제 #4
0
        public static void Main(string[] args)
        {
            var personInfoOutput = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries);

            string firstAndLastName = personInfoOutput[0] + " " + personInfoOutput[1];
            var    street           = personInfoOutput[2];
            var    town             = personInfoOutput[3] + " " + personInfoOutput[4];

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

            var name    = personBeerOutput[0];
            var litters = int.Parse(personBeerOutput[1]);
            var isDrunk = personBeerOutput[2];

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

            var firstName = (numbersInfoOutput[0]);
            var @double   = double.Parse(numbersInfoOutput[1]);
            var bankName  = numbersInfoOutput[2];

            var personInfo = new Threeuple <string, string, string>(firstAndLastName, street, town);

            var personBeer = new Threeuple <string, int, string>(name, litters, isDrunk);

            var numbersInfo = new Threeuple <string, double, string>(firstName, @double, bankName);

            Console.WriteLine(personInfo);
            Console.WriteLine(personBeer);
            Console.WriteLine(numbersInfo);
        }