using System; using System.IO; using System.Collections.Generic; namespace Exercises_C_Sharp.E27_Jagged_Arrays { class Exercise_4 { static int[][] JaggedArray = new int[][] { new int[] {1234, 2712, 993843, 273273, 382783}, new int[] {93847, 3827362, 3049384, 384738, 2938273}, new int[] {3948374, 39485, 3029384, 30493847, 30293849, 2738203}, new int[] {949302, 495874, 483747, 392910, 3049381, 3723901, 39409381, 3784803, 2838499}, new int[] {3892, 29302, 392830, 9583,573483, 38492, 1923, 39403} }; public static void Start() { //Sorgen Sie dafür, dass im Jagged Array oben alle ungeraden Zahlen herausgelöscht werden. Geben Sie dann das Array zur kontrolle aus. //Code START int[][] tempArr = new int[JaggedArray.Length][]; for (int i = 0; i < JaggedArray.Length; i++) { List tempList = []; foreach (var element in JaggedArray[i]) if (element % 2 == 0) tempList.Add(element); tempArr[i] = tempList.ToArray(); } JaggedArray = tempArr; foreach (var arr in JaggedArray) { foreach (var element in arr) { Console.Write(element + " "); } Console.WriteLine(); } //Code ENDE } } }