예제 #1
0
        static void Main(string[] args)
        {
            string[] firstInput = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries);

            CustomTuple <string, string> nameAndAddress = new CustomTuple <string, string>();

            nameAndAddress.item1 = $"{firstInput[0]} {firstInput[1]}";
            nameAndAddress.item2 = $"{firstInput[2]}";

            string[] secondInput = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries);

            CustomTuple <string, int> nameAndLitersOfBeer = new CustomTuple <string, int>();

            nameAndLitersOfBeer.item1 = secondInput[0];
            nameAndLitersOfBeer.item2 = int.Parse(secondInput[1]);

            string[] thirdInput = Console.ReadLine().Split(' ', StringSplitOptions.RemoveEmptyEntries);

            CustomTuple <int, double> integerAndDouble = new CustomTuple <int, double>();

            integerAndDouble.item1 = int.Parse(thirdInput[0]);
            integerAndDouble.item2 = double.Parse(thirdInput[1]);

            Console.WriteLine($"{nameAndAddress.item1} -> {nameAndAddress.item2}");
            Console.WriteLine($"{nameAndLitersOfBeer.item1} -> {nameAndLitersOfBeer.item2}");
            Console.WriteLine($"{integerAndDouble.item1} -> {integerAndDouble.item2}");
        }
예제 #2
0
        static void Main(string[] args)
        {
            string[] nameAdres = Console.ReadLine().Split();

            CustomTuple <string, string> first = new CustomTuple <string, string>(nameAdres[0] + " " + nameAdres[1], nameAdres[2]);

            Console.WriteLine(first);

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

            string name = drunk[0];
            long   beer = long.Parse(drunk[1]);

            CustomTuple <string, long> drunkMan = new CustomTuple <string, long>(name, beer);

            Console.WriteLine(drunkMan);

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

            long   longeger = long.Parse(numbers[0]);
            double floatNum = double.Parse(numbers[1]);

            CustomTuple <long, double> nums = new CustomTuple <long, double>(longeger, floatNum);

            Console.WriteLine(nums);
        }
예제 #3
0
        private static void Main(string[] args)
        {
            var tokens = GetTokens();

            CustomTuple <string, string> tupleOne = new CustomTuple <string, string>((tokens[0] + " " + tokens[1]), tokens[2]);

            tokens = GetTokens();

            CustomTuple <string, int> tupleTwo = new CustomTuple <string, int>(tokens[0], int.Parse(tokens[1]));

            tokens = GetTokens();

            CustomTuple <int, double> tupleThree = new CustomTuple <int, double>(int.Parse(tokens[0]), double.Parse(tokens[1]));

            Console.WriteLine(tupleOne.ToString());
            Console.WriteLine(tupleTwo.ToString());
            Console.WriteLine(tupleThree.ToString());
        }
예제 #4
0
        static void Main(string[] args)
        {
            string[] personInfoInput = Console.ReadLine().Split();
            CustomTuple <string, string, string> personInfo = new CustomTuple <string, string, string>(personInfoInput[0] + " " + personInfoInput[1], personInfoInput[2], personInfoInput[3]);

            Console.WriteLine(personInfo);


            string[] beerInfoInput = Console.ReadLine().Split();
            bool     isDrunk       = beerInfoInput[2] == "drunk";

            CustomTuple <string, int, bool> beerInfo = new CustomTuple <string, int, bool>(beerInfoInput[0], int.Parse(beerInfoInput[1]), isDrunk);

            Console.WriteLine(beerInfo);


            string[] lastInput = Console.ReadLine().Split();
            CustomTuple <string, double, string> lastInfo = new CustomTuple <string, double, string>(lastInput[0], double.Parse(lastInput[1]), lastInput[2]);

            Console.WriteLine(lastInfo);
        }
예제 #5
0
        static void Main(string[] args)
        {
            string[] firstInput = Console.ReadLine().Split(" ");
            string   name       = $"{firstInput[0]} {firstInput[1]}";
            string   address    = firstInput[2];
            CustomTuple <string, string> firstTuple = new CustomTuple <string, string>(name, address);

            string[] secondInput = Console.ReadLine().Split(" ");
            string   secondName  = secondInput[0];
            int      litres      = int.Parse(secondInput[1]);
            CustomTuple <string, int> secondTuple = new CustomTuple <string, int>(secondName, litres);

            string[] thirdInput   = Console.ReadLine().Split(" ");
            int      integerValue = int.Parse(thirdInput[0]);
            double   doubleValue  = double.Parse(thirdInput[1]);
            CustomTuple <int, double> thirdTuple = new CustomTuple <int, double>(integerValue, doubleValue);

            Console.WriteLine(firstTuple);
            Console.WriteLine(secondTuple);
            Console.WriteLine(thirdTuple);
        }
예제 #6
0
        static void Main(string[] args)
        {
            string[] input1 = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries);
            string   name   = input1[0] + " " + input1[1];
            string   adress = input1[2];
            CustomTuple <string, string> tuple1 = new CustomTuple <string, string>(name, adress);

            Console.WriteLine(tuple1.ToString());

            string[] input2      = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries);
            string   singleName  = input2[0];
            int      beerLitters = int.Parse(input2[1]);
            var      tuple2      = new CustomTuple <string, int>(singleName, beerLitters);

            Console.WriteLine(tuple2.ToString());

            string[] input3      = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries);
            int      number      = int.Parse(input3[0]);
            double   floatNumber = double.Parse(input3[1]);
            var      tuple3      = new CustomTuple <int, double>(number, floatNumber);

            Console.WriteLine(tuple3.ToString());
        }
예제 #7
0
        public static void Main(string[] args)
        {
            string[] personInfo = Console.ReadLine().Split();
            string   fullName   = personInfo[0] + " " + personInfo[1];
            string   address    = personInfo[2];

            string[] drinkingAbility = Console.ReadLine().Split();
            string   name            = drinkingAbility[0];
            int      beers           = int.Parse(drinkingAbility[1]);

            string[] inputNumbers = Console.ReadLine().Split();
            int      firstNumber  = int.Parse(inputNumbers[0]);
            double   secondNumber = double.Parse(inputNumbers[1]);



            CustomTuple <string, string> personTuple  = new CustomTuple <string, string>(fullName, address);
            CustomTuple <string, int>    beerTuple    = new CustomTuple <string, int>(name, beers);
            CustomTuple <int, double>    numbersTuple = new CustomTuple <int, double>(firstNumber, secondNumber);

            Console.WriteLine(personTuple);
            Console.WriteLine(beerTuple);
            Console.WriteLine(numbersTuple);
        }