r u b o a r d m a n
BANNED | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору program GuitarCalc; {$APPTYPE CONSOLE} uses SysUtils; var gears: array[0..42] of Integer = (20, 20, 23, 24, 25, 25, 30, 33, 34, 35, 37, 40, 41, 43, 45, 47, 48, 50, 53, 55, 57, 58, 59, 60, 61, 62, 65, 67, 70, 71, 73, 75, 79, 80, 83, 85, 89, 90, 92, 95, 97, 98, 100 ); {gears: array[0..4] of Integer = (1, 2, 3, 4, 5);} fout: TextFile; ia, ib, c: Integer; r: Boolean; begin { TODO -oUser -cConsole Main : Insert code here } AssignFile(fout, 'log.txt'); Rewrite(fout); c := 0; for ia := Low(gears) to High(gears) do begin r := False; for ib := Low(gears) to High(gears) do begin if r then begin Write(fout, IntToStr(gears[ia] * gears[ib]) + ', '); Inc(c); end else r := (ia = ib); end; end; WriteLn(fout, ''); WriteLn(fout, ''); WriteLn(fout, 'Всего: ' + IntToStr(c)); Close(fout); end. |