12.5.6. Napisati program za ispis kao na slici (do 20 redova)::

Opis rješenja:

Listing programa:

PROGRAM p12502004;
USES 
  WinCRT;
CONST
  centar = 33;
VAR
  redmax : 5..10;
  red, kol, zv: INTEGER;
BEGIN
  WRITE('Broj redova ');
  READLN( redmax );
  FOR red := 1 TO redmax DO
    BEGIN
      FOR kol := 1 TO centar - (3*red+1) DO
        WRITE(' ');
      FOR zv := 1 TO red DO
        WRITE(zv:3);
      FOR zv := red - 1 DOWNTO 1 DO
        WRITE(zv:3);
      WRITELN;
    END;
END.

Ispis na ekranu:

Index