Similar Posts

Subscribe
Notify of
3 Answers
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Kwalliteht
1 year ago

Generally speaking, grinding:

repeat
begin {Anfang äußere Schleife}
  x:=1
  while x<100 do
  begin {Anfang mittlere Schleife}
    inc(x);
    for y=:1 to 50 do
    begin {Anfang innere Schleife}
      inc(y);
    end; {Ende innere Schleife}
  end; {Ende mittlere Schleife}
end;
until false; {Ende äußere Schleife}

repeat ... until is the outer loop. It is executed until a certain statement is true.
while... do is the middle loop. It is executed as long as a certain statement is true.
for... to is the inner loop. It is executed, wherein a start value and an end value are predefined. The value is increased by 1. When the final value is reached, the loop is run through last time.

Once you understand, it's quite simple. And then you can solve the task.

Kwalliteht
1 year ago
Reply to  D0012
in etwa so:

// erstmal die Deklarationen
var
Z: int;
T: int;
Lottozahl: array[1..T, 1..Z] of int;

// und hier des auszuführende Code

// die äußere Schleife
for T:=1 to 3 do
begin
  //die innere Schleife
  for Z:=1 to 7 do
  begin
    Lottozahl[T,Z]:= ... hier Deine Zufallsfunktion ...
  end;
  // Ende der inneren Schleife
end;
// Ende der äußeren Schleife