Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace prac_3_ex_1
- {
- class Program
- {
- static string Fun(double x, double y)
- {
- if (Math.Pow(x, 2) + Math.Pow(y, 2) > 625 || Math.Pow(x, 2) + Math.Pow(y, 2) < 225) return "Да";
- else
- if (Math.Pow(x, 2) + Math.Pow(y, 2) == 625 || Math.Pow(x, 2) + Math.Pow(y, 2) == 225) return "На границе";
- else
- return "Нет";
- }
- static void Main(string[] args)
- {
- Console.Write("Введите x: ");
- double x = double.Parse(Console.ReadLine());
- Console.Write("Введите y: ");
- double y = double.Parse(Console.ReadLine());
- Console.WriteLine("Лежит ли точка внутри выделенной области? " + Fun(x, y));
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment