Ejemplo n.º 1
0
        public static void Main(string[] args)
        {
            string[] personInfo = Console.ReadLine().Split();

            string fullname = personInfo[0] + " " + personInfo[1];
            string town     = personInfo[2];

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

            string name   = beerInfo[0];
            int    liters = int.Parse(beerInfo[1]);

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

            int    specialInt    = int.Parse(specialNumbers[0]);
            double specialDouble = double.Parse(specialNumbers[1]);

            SpecialTuple <string, string> personTuple  = new SpecialTuple <string, string>(fullname, town);
            SpecialTuple <string, int>    beerTuple    = new SpecialTuple <string, int>(name, liters);
            SpecialTuple <int, double>    specialTuple = new SpecialTuple <int, double>(specialInt, specialDouble);

            Console.WriteLine(personTuple);
            Console.WriteLine(beerTuple);
            Console.WriteLine(specialTuple);
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            string[] personInfo = Console.ReadLine().Split();

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

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

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

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

            string currentName = info[0];
            double value       = double.Parse(info[1]);
            string bank        = info[2];

            SpecialTuple <string, string, string> personTuple  = new SpecialTuple <string, string, string>(fullName, neightborhood, town);
            SpecialTuple <string, int, bool>      beerTuple    = new SpecialTuple <string, int, bool>(name, litters, isDrunk);
            SpecialTuple <string, double, string> specialTuple = new SpecialTuple <string, double, string>(currentName, value, bank);

            Console.WriteLine(personTuple);
            Console.WriteLine(beerTuple);
            Console.WriteLine(specialTuple);
        }
Ejemplo n.º 3
0
        static void Main(string[] args)
        {
            string[] personInfo = Console.ReadLine().Split();
            string   personName = personInfo[0] + " " + personInfo[1];
            string   adress     = personInfo[2];
            string   town       = personInfo[3];

            string[] beerInfo = Console.ReadLine().Split();
            string   name     = beerInfo[0];
            int      liters   = int.Parse(beerInfo[1]);
            bool     isDrunk  = personInfo[2] == "drunk" ? false : true;

            string[] bankInfo       = Console.ReadLine().Split();
            string   bankHolderName = bankInfo[0];
            double   ballance       = double.Parse(bankInfo[1]);
            string   bankName       = bankInfo[2];


            SpecialTuple <string, string, string> personTuple  = new SpecialTuple <string, string, string>(personName, adress, town);
            SpecialTuple <string, int, bool>      beerTuple    = new SpecialTuple <string, int, bool>(name, liters, isDrunk);
            SpecialTuple <string, double, string> specialTuple = new SpecialTuple <string, double, string>(bankHolderName, ballance, bankName);

            Console.WriteLine(personTuple);
            Console.WriteLine(beerTuple);
            Console.WriteLine(specialTuple);
        }
Ejemplo n.º 4
0
        public static void Main(string[] args)
        {
            string[] firstLine = Console.ReadLine().Split();
            string   fullName  = firstLine[0] + " " + firstLine[1];
            string   address   = firstLine[2];

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

            string[] numbers      = Console.ReadLine().Split();
            int      intNumber    = int.Parse(numbers[0]);
            double   doubleNumber = double.Parse(numbers[1]);

            SpecialTuple <string, string> addressTuple = new SpecialTuple <string, string>(fullName, address);
            SpecialTuple <string, int>    beerTuple    = new SpecialTuple <string, int>(name, beer);
            SpecialTuple <int, double>    numberTuple  = new SpecialTuple <int, double>(intNumber, doubleNumber);

            Console.WriteLine(addressTuple);
            Console.WriteLine(beerTuple);
            Console.WriteLine(numberTuple);
        }