Advertisement
Guest User

09.Поинт

a guest
Oct 15th, 2012
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.10 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace _09.PointInCirleOutOfRec
  7. {
  8.     class PointInCirleOutOfRec
  9.     {
  10.         static void Main(string[] args)
  11.         {
  12.             Console.Write("Enter x: ");
  13.             double x = double.Parse(Console.ReadLine());
  14.             Console.Write("Enter y: ");
  15.             double y = double.Parse(Console.ReadLine());
  16.  
  17.             if (((x - 1) * (x - 1) + (y - 1) * (y - 1)) < 9)
  18.             {
  19.                 if(y > 1)
  20.                 {
  21.                     Console.WriteLine("Point is in circle, outside rec");
  22.                 }
  23.                 else if ((y < 1 || y > -1) && x < -1)
  24.                 {
  25.                     Console.WriteLine("Point is in circle, outside rec");
  26.                 }
  27.                 else if (y < -1)
  28.                 {
  29.                     Console.WriteLine("Point is in circle, outside rec");
  30.                 }
  31.                 else
  32.                 {
  33.                     Console.WriteLine("Point doesn't meet conditions");
  34.                 }
  35.             }
  36.  
  37.  
  38.         }
  39.     }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement