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 1068. Sum

Wrong answer of pascal
Posted by Sergey 29 Aug 2011 15:39
it seems all right, it says: "Wrong answer." Why?

program sum;
var a,suma,I:longint;
begin
  writeln('Vvedite chislo');
  suma:=0;
  readln(a);
    if (a<0) and (a>-10000)  then
  For i:=1 downto a do
      suma:=suma+i;
  if (a>0) and (a<10000)  then
  fOR I:=1 to a do
      suma:=suma+i;
  if (-10000<a)and(a<10000) then
  writeln(suma) else
  writeln('oshibka vvoda');
 end.