Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace лаба1
- {
- class Program
- {
- const double EPS = 1e-7;
- static void Main(string[] args)
- {
- double x, a, c, y;
- Console.Write("Enter x = ");
- x = Convert.ToDouble(Console.ReadLine());
- Console.Write("Enter a = ");
- a = Convert.ToDouble(Console.ReadLine());
- Console.Write("Enter c = ");
- c = Convert.ToDouble(Console.ReadLine());
- if (check(x, a, c))
- {
- y = f(x, a, c);
- Console.WriteLine($"Result = {y}");
- }
- else
- {
- Console.WriteLine(" it is can not be calculated");
- }
- }
- public static double f(double x, double a, double c) =>
- sqrt_3(c * x - a) + (Math.Log(x, Math.E)) / (2 * Math.Sin(Math.PI / 3 + x));
- public static double sqrt_3(double x)
- {
- if (x < 0) { return -1 * Math.Pow(Math.Abs(x), 1.0 / 3); }
- else { return Math.Pow(x, 1.0 / 3); }
- }
- static bool check(double x, double a, double c)
- {
- return (x > EPS && Math.Abs(2 * Math.Sin(Math.PI / 3 + x)) > EPS);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement