Uebungsaufgaben_ITFS2_SS_2025/Exercises/E26_Mehrdimensionale_Arrays/Exercise_1.cs
2025-07-15 16:46:46 +02:00

36 lines
992 B
C#

using System;
using System.IO;
using System.Collections.Generic;
namespace Exercises_C_Sharp.E26_Mehrdimensionale_Arrays
{
class Exercise_1
{
static int[] array1 = new int[]{12,45,21,34,12,45};
static int[] array2 = new int[]{152,475,211,734,812,455};
static int[] array3 = new int[]{1722,4565,2123,3452,12121,3315};
public static void Start()
{
//Führen Sie diese drei oben gezeigten Arrays zu einem Array zusammen
//Code START
int[,] ints = new int[3, 6] {
{12,45,21,34,12,45},
{152,475,211,734,812,455},
{1722,4565,2123,3452,12121,3315}
};
// ODER:
int[,] ints2 = new int[3, 6];
for (int i = 0; i < 6; i++)
{
ints2[0, i] = array1[i];
ints2[1, i] = array2[i];
ints2[2, i] = array3[i];
}
//Code ENDE
}
}
}