desislava777

problem6

Oct 30th, 2017
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication4
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var x1 = double.Parse(Console.ReadLine());
  14. var y1 = double.Parse(Console.ReadLine());
  15. var x2 = double.Parse(Console.ReadLine());
  16. var y2 = double.Parse(Console.ReadLine());
  17. var x = double.Parse(Console.ReadLine());
  18. var y = double.Parse(Console.ReadLine());
  19.  
  20. var onUpSide = (x == x1) && (y >= y1) && (y <= y2);
  21.  
  22. var onDownSide = (x == x2) && (y >= y1) && (y <= y2);
  23.  
  24. var onLeftSide = (y == y1) && (x >= x1) && (x <= x2);
  25.  
  26. var onRightSide = (y == y2) && (x >= x1) && (x <= x2);
  27.  
  28. if (onLeftSide || onRightSide || onUpSide || onDownSide)
  29.  
  30. {
  31.  
  32. Console.WriteLine("Border");
  33.  
  34. }
  35.  
  36. else
  37.  
  38. {
  39.  
  40. Console.WriteLine("Inside / Outside");
  41.  
  42. }
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment