Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace CoordinateSystem
- {
- class CoordinateSystem
- {
- public static void Main(string[] args)
- {
- decimal x = decimal.Parse(Console.ReadLine());
- decimal y = decimal.Parse(Console.ReadLine());
- bool first = x > 0 && y > 0;
- bool second = x < 0 && y > 0;
- bool third = x < 0 && y < 0;
- bool fourth = x > 0 && y < 0;
- bool zero = x == 0 && y == 0;
- bool fifth = x == 0 && y > 0 || y < 0;
- bool sixth = y == 0 && x > 0 || x < 0;
- if(zero)
- {
- Console.WriteLine("0");
- }
- else if(second)
- {
- Console.WriteLine("2");
- }
- else if(third)
- {
- Console.WriteLine("3");
- }
- else if(fourth)
- {
- Console.WriteLine("4");
- }
- else if(fifth)
- {
- Console.WriteLine("5");
- }
- else if(sixth)
- {
- Console.WriteLine("6");
- }
- else if(first)
- {
- Console.WriteLine("1");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement