Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace _1.Problem_CartesianCoordinateSystem
- {
- class Program
- {
- static void Main()
- {
- decimal X, Y;
- decimal minInput = -2000000000001337;
- decimal maxInput = 2000000000001337;
- bool isXLong = decimal.TryParse(Console.ReadLine(), out X);
- bool isYLong = decimal.TryParse(Console.ReadLine(), out Y);
- if (isXLong && isYLong && X >= minInput && X <= maxInput && Y >= minInput && Y <= maxInput)
- {
- if (X == 0 && Y == 0)
- {
- Console.WriteLine("0");
- }
- else if (X == 0)
- {
- Console.WriteLine("5");
- }
- else if (Y == 0)
- {
- Console.WriteLine("6");
- }
- else if (Y > 0 && X > 0)
- {
- Console.WriteLine("1");
- }
- else if (Y > 0 && X < 0)
- {
- Console.WriteLine("2");
- }
- else if (Y < 0 && X < 0)
- {
- Console.WriteLine("3");
- }
- else if (Y < 0 && X > 0)
- {
- Console.WriteLine("4");
- }
- }
- else
- {
- Console.WriteLine("Wrong entry!");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement