4valeri

Cartesian_Coordinate_System

Feb 16th, 2016
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.13 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Problem_1___Cartesian_Coordinate_System
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             decimal x1 = decimal.Parse(Console.ReadLine());
  14.             decimal y1 = decimal.Parse(Console.ReadLine());
  15.  
  16.  
  17.             if (x1 > 0 && y1 > 0)
  18.             {
  19.                 Console.WriteLine("1");
  20.             }
  21.  
  22.             else if (x1 < 0 && y1 > 0)
  23.             {
  24.                 Console.WriteLine("2");
  25.             }
  26.             else if (x1 < 0 && y1 < 0)
  27.             {
  28.                 Console.WriteLine("3");
  29.             }
  30.             else if (x1 > 0 && y1 < 0)
  31.             {
  32.                 Console.WriteLine("4");
  33.             }
  34.             else if (x1 == 0 && y1 != 0)
  35.             {
  36.                 Console.WriteLine("5");
  37.             }
  38.             else if (x1 != 0 && y1 == 0)
  39.             {
  40.                 Console.WriteLine("6");
  41.             }
  42.             else
  43.             {
  44.                 Console.WriteLine("0");
  45.             }
  46.         }
  47.     }
  48. }
Add Comment
Please, Sign In to add comment