Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.69 KB | None | 0 0
  1. class Program
  2.     {
  3.         static bool correct;
  4.         static int numb;
  5.  
  6.         static void Main(string[] args)
  7.         {
  8.             int n = Int32.Parse(Console.ReadLine());
  9.  
  10.             for (int i = 0; i < n; i++)
  11.             {
  12.                 int input = Convert.ToInt32(Console.ReadLine());
  13.  
  14.                 if (i == 0)
  15.                     numb = input;
  16.  
  17.                 if ((numb >= 0 && input >= 0) || (numb < 0 && input < 0))
  18.                     correct = true;
  19.                 else
  20.                     correct = false;
  21.  
  22.                 input = 0;
  23.  
  24.             }
  25.             Console.Write(correct ? "Correct" : "Incorrect");
  26.             Console.ReadLine();
  27.         }
  28.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement