Advertisement
Guest User

Untitled

a guest
Sep 7th, 2013
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.50 KB | None | 0 0
  1.         public static bool IsThere(int[] arr, int num)
  2.         {
  3.             bool checker = false;
  4.             for (int i = 0; i < arr.Length; i++)
  5.                 if (arr[i] == num)
  6.                     checker = true;
  7.             else
  8.             return false;
  9.         }
  10.         public static void Main(string[] args)
  11.         {
  12.             int N = int.Parse(Console.ReadLine());
  13.             int[] array = new int[N];
  14.             Console.WriteLine(IsThere(array, int.Parse(Console.ReadLine())));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement