using System.Collections.Generic;
static int[] union(int[] id1, int[] id2)
int[] _union = new int[N];
for (int i = 0; i < N1; i++)
for (int j = 0; j < id2.Length; j++)
for (int i = 0; i < N1; i++)
int[] _unionRes = new int[N];
for (int i = 0; i < N; i++)
_unionRes[i] = _union[i];
static void inputArray(ref int[] arr, int N)
for (int i = 0; i < arr.Length; i++)
Console.WriteLine("Введите " + (i + 1) + "-элемент");
arr[i] = Convert.ToInt32(Console.ReadLine());
public static void Main(string[] args)
int[] id1 = {1,2,3,4,5 };
int[] id2 = {-1,1,1,2,3,6,7,8 };
Console.WriteLine("Введите размер 1го множества:");
N1 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Введите размер 2го множества:");
N2 = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("Обьединение множеств:");
IEnumerable<int> union12 = union(id1, id2);
foreach (int id in union12)