private string GetAns(string type, string task) { type = GetTypeOfTheTask(type); return(type switch { "math" => MathSolution.GetAns(task), "polynomial-root" => PolynomsSolver.GetRoot(task), "shape" => ShapeSolver.GetAns(task), "determinant" => MatrixDetSolver.GetAns(task), "cypher" => Caesar.GetAns(task), "string-number" => StringNumber.GetNumber(task), "starter" => "42", "inverse-matrix" => InverseMatrix.GetAnswer(task), _ => string.Empty });
private string GetAns(string type, string task) { type = GetTypeOfTheTask(type); return(type switch { "math" => MathSolution.GetAns(task), "polynomial-root" => PolynomsSolver.GetRoot(task), "shape" => ShapeSolver.GetAnswer(task), "determinant" => MatrixDetSolver.GetAns(task), "cypher" => Caesar.GetAns(task), "string-number" => StringNumber.StringToNumber(task), "starter" => "42", "json" => Json.GetAnswer(task), "inverse-matrix" => InverseMatrix.GetAnswer(task), _ => "Я не знаю тип задания, помогите" });
static void Main(string[] args) { /* * const string teamSecret = "wHUYV6IVfJh7akUFzCmSqG9Fk/z/GwX"; // Вставь сюда ключ команды * var challengeClient = new ChallengeClient(teamSecret); * const string challengeId = "projects-course"; * var challenge = challengeClient.GetChallengeAsync(challengeId).Result; * var sender = new Sender(); * sender.ShowResults(challengeClient); * Console.WriteLine("Insert type of your task"); * string type = Console.ReadLine(); * Console.WriteLine("Insert number of tests"); * var count = int.Parse(Console.ReadLine()); * sender.SendSomeAnswers(challengeClient, challenge, type, count); * //*/ Console.WriteLine(StringNumber.GetNumber(Console.ReadLine())); }
private string GetAns(string type, string task) { task = GetTypeOfTheTask(type); switch (type) { case "math": return(MathSolution.GetAns(task)); case "polynomial-root": return(PolynomsSolver.GetRoot(task)); case "shape": return(ShapeSolver.GetAns(task)); case "determinant": return(MatrixDetSolver.GetAns(task)); case "cypher": return(Caesar.GetAns(task)); case "string-number": return(StringNumber.GetNumber(task)); case "starter": return("42"); default: return(string.Empty); } }