static void Main(string[] args) { string[] firstLine = Console.ReadLine().Split(); string fullName = $"{firstLine[0]} {firstLine[1]}"; string address = firstLine[2]; string town = firstLine[3]; Threeuple <string, string, string> firstPerson = new Threeuple <string, string, string>(fullName, address, town); string[] secondLine = Console.ReadLine().Split(); string name = secondLine[0]; int beerAmount = int.Parse(secondLine[1]); string isDrunk = secondLine[2]; bool drunk = false; if (isDrunk == "drunk") { drunk = true; } Threeuple <string, int, bool> secondPerson = new Threeuple <string, int, bool>(name, beerAmount, drunk); string[] thirdLine = Console.ReadLine().Split(); string nameAgain = thirdLine[0]; double balance = double.Parse(thirdLine[1]); string bankName = thirdLine[2]; Threeuple <string, double, string> thirdPerson = new Threeuple <string, double, string>(nameAgain, balance, bankName); Console.WriteLine(firstPerson); Console.WriteLine(secondPerson); Console.WriteLine(thirdPerson); }
static void Main(string[] args) { string[] firstInput = Console.ReadLine() .Split(" ", StringSplitOptions.RemoveEmptyEntries); string name = firstInput[0] + " " + firstInput[1]; string address = firstInput[2]; string town = firstInput[3]; string[] secondInput = Console.ReadLine() .Split(" ", StringSplitOptions.RemoveEmptyEntries); string name2 = secondInput[0]; int amountOfBeer = int.Parse(secondInput[1]); string check = secondInput[2]; bool drunkOrNot = false; if (check == "drunk") { drunkOrNot = true; } string[] thirdInput = Console.ReadLine() .Split(" ", StringSplitOptions.RemoveEmptyEntries); string name3 = thirdInput[0]; double bankBalance = double.Parse(thirdInput[1]); string bankName = thirdInput[2]; Threeuple <string, string, string> nameWithAddressAndTown = new Threeuple <string, string, string>(name, address, town); Threeuple <string, int, bool> nameAndAmountOfBeer = new Threeuple <string, int, bool>(name2, amountOfBeer, drunkOrNot); Threeuple <string, double, string> NameWithBankBallanceAndBankName = new Threeuple <string, double, string>(name3, bankBalance, bankName); Console.WriteLine(nameWithAddressAndTown); Console.WriteLine(nameAndAmountOfBeer); Console.WriteLine(NameWithBankBallanceAndBankName); }
public static void Main(string[] args) { string[] inputOne = Console.ReadLine().Split(); var threeupleOne = new Threeuple <string, string, string>( $"{inputOne[0]} {inputOne[1]}", inputOne[2], inputOne[3]); string[] inputTwo = Console.ReadLine().Split(); var threeupleTwo = new Threeuple <string, int, bool>( inputTwo[0], int.Parse(inputTwo[1]), inputTwo[2] == "drunk"); string[] inputThree = Console.ReadLine().Split(); var threeupleThree = new Threeuple <string, double, string>( inputThree[0], double.Parse(inputThree[1]), inputThree[2]); Console.WriteLine(threeupleOne.ToString()); Console.WriteLine(threeupleTwo.ToString()); Console.WriteLine(threeupleThree.ToString()); }
static void Main(string[] args) { string[] firstInput = Console.ReadLine() .Split(); string name = firstInput[0] + " " + firstInput[1]; string address = firstInput[2]; string town = firstInput[3]; Threeuple <string, string, string> firsTuple = new Threeuple <string, string, string>(name, address, town); string[] secInput = Console.ReadLine() .Split(); string secName = secInput[0]; int litres = int.Parse(secInput[1]); bool isDrunk = secInput[2].ToLower() == "drunk" ? true : false; Threeuple <string, int, bool> secTuple = new Threeuple <string, int, bool>(secName, litres, isDrunk); string[] thirdInput = Console.ReadLine() .Split(); string thirdName = thirdInput[0]; double balance = double.Parse(thirdInput[1]); string bankName = thirdInput[2]; Threeuple <string, double, string> thirdTuple = new Threeuple <string, double, string>(thirdName, balance, bankName); Console.WriteLine(firsTuple); Console.WriteLine(secTuple); Console.WriteLine(thirdTuple); }
static void Main(string[] args) { string[] firstInput = Console.ReadLine().Split(); string names = $"{firstInput[0]} {firstInput[1]}"; string addres = firstInput[2]; string town = firstInput.Length == 4 ? firstInput[3] : $"{firstInput[3]} {firstInput[4]}"; Threeuple <string, string, string> first = new Threeuple <string, string, string>(names, addres, town); string[] secondInput = Console.ReadLine().Split(); string name = secondInput[0]; int beer = int.Parse(secondInput[1]); bool drunkOrNot = secondInput[2] == "drunk" ? true : false; Threeuple <string, int, bool> second = new Threeuple <string, int, bool>(name, beer, drunkOrNot); string[] thirdInput = Console.ReadLine().Split(); string personName = thirdInput[0]; double accountBalance = double.Parse(thirdInput[1]); string bankName = thirdInput[2]; Threeuple <string, double, string> third = new Threeuple <string, double, string>(personName, accountBalance, bankName); Console.WriteLine($"{first.Item1} -> {first.Item2} -> {first.Item3}"); Console.WriteLine($"{second.Item1} -> {second.Item2} -> {second.Item3}"); Console.WriteLine($"{third.Item1} -> {third.Item2} -> {third.Item3}"); }
public static void Main(string[] args) { string[] inputPersonInfo = Console.ReadLine() .Split(); string[] inputPersonBeer = Console.ReadLine() .Split(); string[] inputBankAccount = Console.ReadLine() .Split(); string fullName = inputPersonInfo[0] + " " + inputPersonInfo[1]; string address = inputPersonInfo[2]; string town = string.Join(" ", inputPersonInfo.Skip(3)); string name = inputPersonBeer[0]; int liters = int.Parse(inputPersonBeer[1]); bool isDrunk = inputPersonBeer[2] == "drunk" ? true : false; string nameOfAccount = inputBankAccount[0]; double accountBalance = double.Parse(inputBankAccount[1]); string bankName = inputBankAccount[2]; var personInfo = new Threeuple <string, string, string>(fullName, address, town); var personBeer = new Threeuple <string, int, bool>(name, liters, isDrunk); var accountDetails = new Threeuple <string, double, string>(nameOfAccount, accountBalance, bankName); Console.WriteLine(personInfo); Console.WriteLine(personBeer); Console.WriteLine(accountDetails); }
static void Main(string[] args) { var input1 = Console.ReadLine().Split(); var firstName = input1[0]; var lastName = input1[1]; var adress = input1[2]; var town = input1[3]; var fullName = firstName + ' ' + lastName; var threeuple1 = new Threeuple <string, string, string>(fullName, adress, town); Console.WriteLine(threeuple1); var input2 = Console.ReadLine().Split(); var name = input2[0]; var litters = int.Parse(input2[1]); var condition = input2[2]; bool isDrunk = false; if (condition == "drunk") { isDrunk = true; } var threeuple2 = new Threeuple <string, int, bool>(name, litters, isDrunk); Console.WriteLine(threeuple2); var input3 = Console.ReadLine().Split(); var userName = input3[0]; var ballance = double.Parse(input3[1]); var bankName = input3[2]; var threeuple3 = new Threeuple <string, double, string>(userName, ballance, bankName); Console.WriteLine(threeuple3); }
static void Main(string[] args) { string[] firstTokens = Console.ReadLine().Split(); Threeuple <string, string, string> firstLine = new Threeuple <string, string, string>(); firstLine.Item1 = $"{firstTokens[0]} {firstTokens[1]}"; firstLine.Item2 = firstTokens[2]; if (firstTokens.Length == 4) { firstLine.Item3 = firstTokens[3]; } else { firstLine.Item3 = $"{firstTokens[3]} {firstTokens[4]}"; } string[] secondTokens = Console.ReadLine().Split(); Threeuple <string, int, bool> secondLine = new Threeuple <string, int, bool>(); secondLine.Item1 = secondTokens[0]; secondLine.Item2 = int.Parse(secondTokens[1]); secondLine.Item3 = secondTokens[2] == "drunk" ? true : false; string[] thirdTokens = Console.ReadLine().Split(); Threeuple <string, double, string> thirdLine = new Threeuple <string, double, string>(); thirdLine.Item1 = thirdTokens[0]; thirdLine.Item2 = double.Parse(thirdTokens[1]); thirdLine.Item3 = thirdTokens[2]; Console.WriteLine(firstLine); Console.WriteLine(secondLine); Console.WriteLine(thirdLine); }
public static void Main() { string[] input = Console.ReadLine() .Split(); string names = input[0] + " " + input[1]; string adress = input[2]; string city = input[3]; Threeuple <string, string, string> firstLine = new Threeuple <string, string, string>(names, adress, city); Console.WriteLine(firstLine.ToString()); input = Console.ReadLine() .Split(); string name = input[0]; double littersOfBeers = double.Parse(input[1]); bool drunkOrNot = input[2] == "drunk" ? true : false; Threeuple <string, double, bool> secondLine = new Threeuple <string, double, bool>(name, littersOfBeers, drunkOrNot); Console.WriteLine(secondLine.ToString()); input = Console.ReadLine() .Split(); string personName = input[0]; double accountBalance = double.Parse(input[1]); string bankNmae = input[2]; Threeuple <string, double, string> thirdLine = new Threeuple <string, double, string>(personName, accountBalance, bankNmae); Console.WriteLine(thirdLine.ToString()); }
static void Main(string[] args) { string[] inputOne = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries); string personName = $"{inputOne[0]} {inputOne[1]}"; string address = inputOne[2]; string town = string.Empty; for (int i = 3; i < inputOne.Length; i++) { town += inputOne[i] + " "; } Threeuple <string, string, string> personInfo = new Threeuple <string, string, string>(personName, address, town); string[] inputTwo = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries); string name = inputTwo[0]; int beerAmount = int.Parse(inputTwo[1]); string drunkOrNot = inputTwo[2]; bool isDrunk = drunkOrNot == "drunk"; Threeuple <string, int, bool> beerInfo = new Threeuple <string, int, bool>(name, beerAmount, isDrunk); string[] inputThree = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries); string nameTwo = inputThree[0]; double accountBalance = double.Parse(inputThree[1]); string bankName = inputThree[2]; Threeuple <string, double, string> bankInfo = new Threeuple <string, double, string>(nameTwo, accountBalance, bankName); Console.WriteLine(personInfo); Console.WriteLine(beerInfo); Console.WriteLine(bankInfo); }
static void Main(string[] args) { string[] firstArr = Console.ReadLine().Split(); string fullName = $"{firstArr[0]} {firstArr[1]}"; string adress = firstArr[2]; string town = string.Empty; if (firstArr.Length == 4) { town = firstArr[3]; } else { town = $"{firstArr[3]} {firstArr[4]}"; } Threeuple <string, string, string> first = new Threeuple <string, string, string> (fullName, adress, town); string[] secondArr = Console.ReadLine() .Split(); string name = secondArr[0]; int liters = int.Parse(secondArr[1]); string thirdParam = string.Empty; if (secondArr[2] == "drunk") { thirdParam = "True"; } else { thirdParam = "False"; } Threeuple <string, int, string> second = new Threeuple <string, int, string> (name, liters, thirdParam); string[] thirdArr = Console.ReadLine() .Split(); string nameAgain = thirdArr[0]; double accountBalance = double.Parse(thirdArr[1]); string bankName = thirdArr[2]; Threeuple <string, double, string> third = new Threeuple <string, double, string> (nameAgain, accountBalance, bankName); Console.WriteLine(first); Console.WriteLine(second); Console.WriteLine(third); }
static void Main(string[] args) { string[] firstTokens = Console.ReadLine().Split(); string personFullName = firstTokens[0] + " " + firstTokens[1]; string personAddress = firstTokens[2]; string personTown = string.Empty; if (firstTokens.Length == 4) { personTown = firstTokens[3]; } else { personTown = firstTokens[3] + " " + firstTokens[4]; } Threeuple <string, string, string> firstPersonInfo = new Threeuple <string, string, string>(personFullName, personAddress, personTown); Console.WriteLine(firstPersonInfo.ToString()); string[] secondTokens = Console.ReadLine().Split(); string name = secondTokens[0]; int litersBeer = int.Parse(secondTokens[1]); string drunk = secondTokens[2]; Threeuple <string, int, string> secondPersonInfo = new Threeuple <string, int, string>("", 0, ""); if (drunk == "drunk") { secondPersonInfo = new Threeuple <string, int, string>(name, litersBeer, "True"); } else { secondPersonInfo = new Threeuple <string, int, string>(name, litersBeer, "False"); } Console.WriteLine(secondPersonInfo); string[] thirdTokens = Console.ReadLine().Split(); string personName = thirdTokens[0]; double balance = double.Parse(thirdTokens[1]); string bankName = thirdTokens[2]; Threeuple <string, double, string> thirdPersonInfo = new Threeuple <string, double, string>(personName, balance, bankName); Console.WriteLine(thirdPersonInfo); }
static void Main(string[] args) { string[] input1 = Console.ReadLine().Split(); string[] input2 = Console.ReadLine().Split(); string[] input3 = Console.ReadLine().Split(); string name = input1[0] + " " + input1[1]; Threeuple <string, string, string> threeuple1 = new Threeuple <string, string, string>(name, input1[2], input1[3]); bool isDrunk = input2[2] == "drunk"; Threeuple <string, int, bool> threeuple2 = new Threeuple <string, int, bool>(input2[0], int.Parse(input2[1]), isDrunk); Threeuple <string, double, string> threeuple3 = new Threeuple <string, double, string>(input3[0], double.Parse(input3[1]), input3[2]); threeuple1.Print(); threeuple2.Print(); threeuple3.Print(); }
static void Main(string[] args) { string[] 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); }
public static void Main() { string[] firstLine = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries); var firstThreeple = new Threeuple <string, string, string>($"{firstLine[0]} {firstLine[1]}", firstLine[2], firstLine[3]); string[] secondLine = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries); var secondThreeple = new Threeuple <string, int, bool>(secondLine[0], int.Parse(secondLine[1]), secondLine[2] == "drunk"); string[] thirdLine = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries); var thirdThreeple = new Threeuple <string, double, string>(thirdLine[0], double.Parse(thirdLine[1]), thirdLine[2]); Console.WriteLine(firstThreeple); Console.WriteLine(secondThreeple); Console.WriteLine(thirdThreeple); }
static void Main(string[] args) { string[] firstInput = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries); string fistName = firstInput[0]; string lastName = firstInput[1]; string address = firstInput[2]; string town = String.Empty; if (firstInput.Length == 5) { town = $"{firstInput[3]} {firstInput[4]}"; } else { town = firstInput[3]; } string firstItem = $"{fistName} {lastName}"; Threeuple <string, string, string> fistThreeuple = new Threeuple <string, string, string>(firstItem, address, town); string[] secondInput = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries); string name = secondInput[0]; int drankBeer = int.Parse(secondInput[1]); string state = secondInput[2]; bool isDrunk = false; if (state == "drunk") { isDrunk = true; } Threeuple <string, int, bool> secondThreeuple = new Threeuple <string, int, bool>(name, drankBeer, isDrunk); string[] thirdInput = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries); string personName = thirdInput[0]; double accountBalance = double.Parse(thirdInput[1]); string bankName = thirdInput[2]; Threeuple <string, double, string> thirdThreeuple = new Threeuple <string, double, string>(personName, accountBalance, bankName); Console.WriteLine(fistThreeuple); Console.WriteLine(secondThreeuple); Console.WriteLine(thirdThreeuple); }
static void Main(string[] args) { var input = Console.ReadLine() .Split(" "); var name = input[0] + " " + input[1]; var tuple1 = new Threeuple <string, string, string>(name, input[2], input[3]); Console.WriteLine(tuple1); input = Console.ReadLine() .Split(" "); var boolean = input[2] == "drunk" ? true : false; var tuple2 = new Threeuple <string, int, bool>(input[0], int.Parse(input[1]), boolean); Console.WriteLine(tuple2); input = Console.ReadLine() .Split(" "); var tuple3 = new Threeuple <string, double, string>(input[0], double.Parse(input[1]), input[2]); Console.WriteLine(tuple3); }
static void Main(string[] args) { var input = Console.ReadLine().Split(); string name = $"{input[0]} {input[1]}"; string address = input[2]; StringBuilder sb = new StringBuilder(); for (int i = 3; i < input.Length; i++) { sb.Append($"{input[i]} "); } string city = sb.ToString().TrimEnd(); Threeuple <string, string, string> threeuple1 = new Threeuple <string, string, string>(name, address, city); Console.WriteLine(threeuple1); input = Console.ReadLine().Split(); name = input[0]; int beer = int.Parse(input[1]); string isDrunk = input[2]; bool boolResult = Threeuple <string, int, bool> .IsDrunk(isDrunk); Threeuple <string, int, bool> threeuple2 = new Threeuple <string, int, bool>(name, beer, boolResult); Console.WriteLine(threeuple2); input = Console.ReadLine().Split(); name = input[0]; double account = double.Parse(input[1]); string bank = input[2]; Threeuple <string, double, string> threeuple3 = new Threeuple <string, double, string>(name, account, bank); Console.WriteLine(threeuple3); }
static void Main(string[] args) { string[] nameAndAddress = Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries); string fullName = $"{nameAndAddress[0]} {nameAndAddress[1]}"; string address = nameAndAddress[2]; var town = string.Join(" ", nameAndAddress.Skip(3)); Threeuple <string, string, string> strTuple = new Threeuple <string, string, string>(fullName, address, town); Console.WriteLine(strTuple); //------------------------------------------------------------------------------------------------- string[] nameBeersCountAndCondition = Console.ReadLine().Split(); string name = nameBeersCountAndCondition[0]; int litersOfBeer = int.Parse(nameBeersCountAndCondition[1]); bool isDrunk = nameBeersCountAndCondition[2] == "drunk" ? true : false; Threeuple <string, int, bool> strAndIntTuple = new Threeuple <string, int, bool>(name, litersOfBeer, isDrunk); Console.WriteLine(strAndIntTuple); //------------------------------------------------------------------------------------------------- string[] numbersInput = Console.ReadLine().Split(); string firstName = numbersInput[0]; double accountBalance = double.Parse(numbersInput[1]); string bankName = numbersInput[2]; Threeuple <string, double, string> integerAndDoubleTuple = new Threeuple <string, double, string>(firstName, accountBalance, bankName); Console.WriteLine(integerAndDoubleTuple); }
static void Main(string[] args) { string[] firstTupleData = Console.ReadLine().Split(); string fullName = $"{firstTupleData[0]} {firstTupleData[1]}"; List <string> townData = firstTupleData.Skip(3).ToList(); string town = string.Join(" ", townData); Threeuple <string, string, string> firstThreeuple = new Threeuple <string, string, string>(fullName, firstTupleData[2], town); string[] secondTupleData = Console.ReadLine().Split(); bool drunk = secondTupleData[2] == "drunk" ? true : false; Threeuple <string, int, bool> secondThreeuple = new Threeuple <string, int, bool>(secondTupleData[0], int.Parse(secondTupleData[1]), drunk); string[] thirdTupleData = Console.ReadLine().Split(); Threeuple <string, double, string> thirdThreeuple = new Threeuple <string, double, string>(thirdTupleData[0], double.Parse(thirdTupleData[1]), thirdTupleData[2]); Console.WriteLine(firstThreeuple); Console.WriteLine(secondThreeuple); Console.WriteLine(thirdThreeuple); }