Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace ConsoleApplication1
- {
- class Program
- {
- static bool Equal(int[] a, int num)
- {
- bool flag;
- int counter=0;
- for (int i = 0; i < a.Length; i++)
- {
- if (num == a[i])
- counter++;
- }
- if (counter > 0)
- {
- flag = true;
- return flag;
- }
- if (counter == 0)
- {
- flag = false;
- return flag;
- }
- static void Main(string[] args)
- {
- int[] a = new int[6];
- for (int i = 0; i < 6; i++)
- {
- Console.WriteLine("insert number");
- a[i] = int.Parse(Console.ReadLine());
- }
- Console.WriteLine("insert number");
- int num=int.Parse(Console.ReadLine());
- bool eqalp = Equal(a,num);
- if (eqalp)
- Console.WriteLine("good");
- if(eqalp==false)
- Console.WriteLine("bad");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement