|
|
back to boardMy Solution Here: Posted by Destiny 11 Nov 2002 18:03 program sinus; var i,n,depth:integer; procedure calc(i:integer); var j:integer; begin if i=depth+1 then for j:=1 to depth do write(')') else begin write('sin(',i); if i<depth then if odd(i) then write('-') else write('+'); calc(i+1); end; end; begin readln(n); for i:=1 to n-1 do write('('); for i:=1 to n-1 do begin depth:=i; calc(1); write('+',n-i+1,')'); end; depth:=n; calc(1); writeln('+1'); end. OK,accept Posted by zhbs 14 Nov 2002 12:49 |
|
|