Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class CartesianCoordinateSystem
- {
- static void Main()
- {
- decimal X = decimal.Parse(Console.ReadLine());
- decimal Y = decimal.Parse(Console.ReadLine());
- FindQuadrants(X, Y);
- }
- static void FindQuadrants(decimal X, decimal Y)
- {
- if(X == 0 && Y == 0)
- {
- Console.WriteLine(0);
- }
- else if(X > 0 && Y > 0)
- {
- Console.WriteLine(1);
- }
- else if(X == 0)//ако X е нула Y няма значение колко е
- {
- Console.WriteLine(5);
- }
- else if(Y == 0)
- {
- Console.WriteLine(6);
- }
- else if(X < 0 && Y > 0)
- {
- Console.WriteLine(2);
- }
- else if(X < 0 && Y < 0)
- {
- Console.WriteLine(3);
- }
- else if(X > 0 && Y < 0)
- {
- Console.WriteLine(4);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment