RosettaCodeData/Task/Create-a-two-dimensional-array-at-runtime/Elena/create-a-two-dimensional-array-at-runtime-2.elena

19 lines
437 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
import system'routines;
import extensions;
2026-02-01 16:33:20 -08:00
public Program()
2023-07-01 11:58:00 -04:00
{
auto n := new Integer();
auto m := new Integer();
2025-08-11 18:05:26 -07:00
Console.write("Enter two space delimited integers:");
Console.loadLine(n,m);
2023-07-01 11:58:00 -04:00
2024-03-06 22:25:12 -08:00
auto myArray2 := new object[][](n.Value).populate::(int i => (new object[](m.Value)) );
2023-07-01 11:58:00 -04:00
myArray2[0][0] := 2;
myArray2[1][0] := "Hello";
2025-08-11 18:05:26 -07:00
Console.printLine(myArray2[0][0]);
Console.printLine(myArray2[1][0]);
2023-07-01 11:58:00 -04:00
}