program pilet; uses crt; var number: integer; hind,summa: real; f: text; procedure alusta; var i: integer; begin clrscr; textcolor(green); gotoxy(1, 1); for i:=1 to 80 do write(''); for i:=1 to 24 do begin gotoxy( 1, i); write(''); gotoxy(80, i); write(''); end; gotoxy(1, 24); for i:=1 to 80 do write(''); gotoxy(25, 10); write('Pileti hind:'); gotoxy(55, 18); write('summa:'); assign(f, 'pilet.txt'); rewrite(f); close(f); summa:=0; number:=10000; textcolor(white); end; procedure loe_hind; begin gotoxy(55, 19); write(' ':10); gotoxy(55, 19); write(summa:7:2); gotoxy(25, 11); write(' ':10); gotoxy(25, 11); readln(hind); end; procedure tryki_pilet; var i: integer; begin append(f); writeln(f, 'Taaralinna transpordikeskus'); writeln(f); writeln(f, 'Lunastasite pileti nr. ',number); writeln(f, 'maksumusega ',hind:5:2,' kr.'); writeln(f, 'Uute kohtumisteni!'); for i:=1 to 5 do writeln(f); close(f); number:=number+1; summa:=summa+hind; end; procedure ots; begin clrscr; writeln('Tna mdi ',number-10000,' piletit ', 'kogusummaga ',summa:6:2,' krooni'); readln; end; begin alusta; loe_hind; while(hind>0) do begin tryki_pilet; loe_hind; end; ots; textmode(lastmode); end.