Letöltés: fa_par.dpr {$A+,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O+,P+,Q+,R+,S-,T-,U+,V+,W+,X+,Y+,Z1} {$MINSTACKSIZE $00004000} {$MAXSTACKSIZE $00100000} {$IMAGEBASE $00400000} {$APPTYPE CONSOLE} program felbont; uses SysUtils; Var t : array [1..100] of integer; Procedure felb(n,szint:integer); Var i : integer; Begin If n=0 then Begin for i:=1 to szint-2 do write(t[i],'+'); Writeln(t[szint-1]); End; For i:=1 to n do Begin {i+(n-i)} t[szint]:=i; {If monoton csokkeno then csinald} If szint=1 then felb(n-i,szint+1) else If (szint>1)and(t[szint-1]>=i) then felb(n-i,szint+1); End; End; begin felb(5,1); Readln; end. |