Advertisement
petromaxa

Untitled

Dec 11th, 2012
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace _1.Problem_CartesianCoordinateSystem
  7. {
  8. class Program
  9. {
  10. static void Main()
  11. {
  12. decimal X, Y;
  13. decimal minInput = -2000000000001337;
  14. decimal maxInput = 2000000000001337;
  15. bool isXLong = decimal.TryParse(Console.ReadLine(), out X);
  16. bool isYLong = decimal.TryParse(Console.ReadLine(), out Y);
  17. if (isXLong && isYLong && X >= minInput && X <= maxInput && Y >= minInput && Y <= maxInput)
  18. {
  19. if (X == 0 && Y == 0)
  20. {
  21. Console.WriteLine("0");
  22. }
  23. else if (X == 0)
  24. {
  25. Console.WriteLine("5");
  26. }
  27. else if (Y == 0)
  28. {
  29. Console.WriteLine("6");
  30. }
  31. else if (Y > 0 && X > 0)
  32. {
  33. Console.WriteLine("1");
  34. }
  35. else if (Y > 0 && X < 0)
  36. {
  37. Console.WriteLine("2");
  38. }
  39. else if (Y < 0 && X < 0)
  40. {
  41. Console.WriteLine("3");
  42. }
  43. else if (Y < 0 && X > 0)
  44. {
  45. Console.WriteLine("4");
  46. }
  47. }
  48. else
  49. {
  50. Console.WriteLine("Wrong entry!");
  51. }
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement