Advertisement
Guest User

Untitled

a guest
Nov 21st, 2016
334
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace _03.PointInRectangle
  5. {
  6. class PointInRectangle
  7. {
  8. static void Main()
  9. {
  10.  
  11. var x1 = decimal.Parse(Console.ReadLine());
  12. var y1 = decimal.Parse(Console.ReadLine());
  13. var x2 = decimal.Parse(Console.ReadLine());
  14. var y2 = decimal.Parse(Console.ReadLine());
  15. var x = decimal.Parse(Console.ReadLine());
  16. var y = decimal.Parse(Console.ReadLine());
  17.  
  18. if ((y==y1 ||y==y2)&&(x==x1||x==x2)&&(x>=x1)&&(x<=x2)&&(y>=y)&&(y<=y2))
  19. {
  20. Console.WriteLine("inside");
  21. }
  22. else
  23. {
  24. Console.WriteLine("outside");
  25. }
  26.  
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement