... For i:=1 to n If i mod = then a[i]:=i*a[i-1] Else a[i]:=i+a[i-1]; Assign(f,'Position.out'); Rewrite(f); Write(f,a[n]); Close(f); End; end Bài : Program Bai2; Var i, n, dau, cuoi : Byte; S, T : ... then Begin T:=T-a[dau]; Inc(dau); End; End; Assign(f,'Subarray.out'); Rewrite(f); If T=S then For i:=dau to cuoi Write(f,a[i],' ') Else Write(f,'$'); Close(f); End; End Bài : Program Bai3; Uses ... Halt; End; Procedure Try(i:integer); Var j:Integer; Begin For j:=1 to n If c[j] and (abs(a[j]-a[b[i-1]])>0) then Begin b[i]:=j; c[j]:=False; If i=n then Test else Try(i+1); c[j]:=true; End; End;...