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 ); ia, ib, ic: Integer; fout: TextFile; begin { TODO -oUser -cConsole Main : Insert code here } AssignFile(fout, 'log.txt'); Rewrite(fout); ic := 0; for ia := Low(gears) to High(gears) do begin for ib := Low(gears) to High(gears) do begin if (ia <> ib) then Write(fout, IntToStr(gears[ia] * gears[ib]) + ', '); Inc(ic); end; end; WriteLn(fout, ''); WriteLn(fout, ''); WriteLn(fout, IntToStr(ic)); Close(fout); end. |