ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1149. Sinus Dances

No subject
Posted by Reinforcement 4 Jan 2003 18:58
Why my program wrong?
Program T1149;
Var i,n:1..200;
Procedure a(p:integer);
Var i,j:integer;
Begin
     For  i:=1 to p do Begin
          write('sin');
          if i=p then Begin write('(',i,')');break;end
          else If odd(i) then write('(',i,'-')
                         else write('(',i,'+');
          end;
end;

Procedure s(n:integer);
Var i,j,k:integer;
Begin
     k:=n;
     For i:=1 to n-1 do write('(');
     For i:=1 to n-1 do Begin
         a(i);write('+',k-i+1,')');
         End;
     a(n);write('+1');
end;

Begin
     Readln(n);
     s(n);
     For i:=1 to n-1 do write(')');
     Readln
End.