using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Vectori { class Program { static void Main(string[] args) { int[] a = { 2, 5, 8 }, b, c; int n, i, j, k, m = 3; Console.WriteLine("Nr. de elemente pentru al doilea sir:"); n = Convert.ToInt32(Console.ReadLine()); b = new int[n]; Console.WriteLine("Elementele sirului (introduse cu enter)"); for (i = 0; i < b.Length; i++) b[i] = Convert.ToInt32(Console.ReadLine()); Array.Sort(b); i = j = k = 0; c = new Int32[a.Length + b.Length]; while (i < a.Length && j < b.Length) if (a[i] < b[j]) c[k++] = a[i++]; else c[k++] = b[j++]; while (i < a.Length) c[k++] = a[i++]; while (j < b.Length) c[k++] = b[j++]; Scrie(a); Scrie(b); Scrie(c); } static void Scrie(int[] v) { //for (int i = 0; i < v.Length; i++) //Console.Write(v[i] + " "); foreach (int x in v) Console.Write(x + " "); Console.WriteLine(); } } }