staafl

problem 1 - coordinate system

Mar 30th, 2014
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5. static void Main()
  6. {
  7. long x = long.Parse(Console.ReadLine());
  8. long y = long.Parse(Console.ReadLine());
  9.  
  10. if (x > 0)
  11. {
  12. if (y > 0)
  13. {
  14. Console.WriteLine(1);
  15. }
  16. else if (y == 0)
  17. {
  18. Console.WriteLine(6);
  19. }
  20. else
  21. {
  22. Console.WriteLine(4);
  23. }
  24. }
  25. else if (x < 0)
  26. {
  27. if (y > 0)
  28. {
  29. Console.WriteLine(2);
  30. }
  31. else if (y == 0)
  32. {
  33. Console.WriteLine(6);
  34. }
  35. else
  36. {
  37. Console.WriteLine(3);
  38. }
  39. }
  40. else
  41. {
  42. if (y == 0)
  43. {
  44. Console.WriteLine(0);
  45. }
  46. else
  47. {
  48. Console.WriteLine(5);
  49. }
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment