Advertisement
Sephinroth

prac 3 ex 1

Sep 21st, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace prac_3_ex_1
  7. {
  8.     class Program
  9.     {
  10.         static double Fun(double x)
  11.         {
  12.             return Math.Sqrt(Math.Pow(x, 2) - 1);
  13.         }
  14.         static void Main(string[] args)
  15.         {
  16.             Console.Write("Введите x: ");
  17.             double x = double.Parse(Console.ReadLine());
  18.             if (x < 0) Console.WriteLine("y = {0}", Fun(x));
  19.                 else Console.WriteLine("Функция не определена в данной точке");
  20.             Console.ReadKey();
  21.  
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement