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

What's wrong with my program?
Posted by Temp 1 Jul 2002 06:14
Program P1149;
  Var
    Temp,N:Integer;

  Procedure A(Num:Integer);
    Var
      Temp:Integer;
    Begin
      For Temp:=1 To Num Do
        Begin
          Write('sin(');
          If Temp=Num Then Write(Num,')')
            Else If Temp=1 Then Write(Temp,'-')
              Else Write(Temp,'+');
        End;
      For Temp:=1 To Num-1 Do Write(')');
    End;

  Begin
    Readln(N);
    For Temp:=1 To N-1 Do Write('(');
    For Temp:=1 To N Do
      Begin
        A(Temp);
        Write('+',N-Temp+1);
        If Temp<>N Then Write(')');
      End;
  End.
if odd(temp) then write('-') else write('+')
Posted by Maigo Akisame (maigoakisame@yahoo.com.cn) 18 Jul 2004 08:04