Sephinroth

prac 3 ex 2

Sep 21st, 2019
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 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 string Fun(double x, double y)
  11.         {
  12.             if (Math.Pow(x, 2) + Math.Pow(y, 2) > 625 || Math.Pow(x, 2) + Math.Pow(y, 2) < 225) return "Да";
  13.             else
  14.                 if (Math.Pow(x, 2) + Math.Pow(y, 2) == 625 || Math.Pow(x, 2) + Math.Pow(y, 2) == 225) return "На границе";
  15.                 else
  16.                     return "Нет";
  17.         }
  18.         static void Main(string[] args)
  19.         {
  20.             Console.Write("Введите x: ");
  21.             double x = double.Parse(Console.ReadLine());
  22.             Console.Write("Введите y: ");
  23.             double y = double.Parse(Console.ReadLine());
  24.             Console.WriteLine("Лежит ли точка внутри выделенной области? " + Fun(x, y));
  25.             Console.ReadKey();
  26.  
  27.         }
  28.     }
  29. }
Add Comment
Please, Sign In to add comment