Advertisement
Guest User

Untitled

a guest
Feb 12th, 2016
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 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 PointinFigure
  7. {
  8. class PointinFigure
  9. {
  10. static void Main(string[] args)
  11. {
  12. var h = double.Parse(Console.ReadLine());
  13. var x = double.Parse(Console.ReadLine());
  14. var y = double.Parse(Console.ReadLine());
  15.  
  16. var Inside = (x >= 0 && x < (3 * h) && y > 0 && y < h) || (x > h && x < (2 * h) && y > h && y < (4 * h));
  17. var Outside = (x < 0 || x > (3 * h) || y < 0 || y > h) || (x < h && x > (2 * h) || y < h || y > (4 * h));
  18.  
  19.  
  20. if (y != 0 && Inside)
  21. {
  22. Console.WriteLine("Inside");
  23. }
  24. else if (y != 0 && Outside)
  25. {
  26. Console.WriteLine("Outside");
  27. }
  28. else
  29. {
  30. Console.WriteLine("Border");
  31. }
  32. }
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement