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

Please, help... Wrong answear...
Posted by [SSTtU] Zaznaj 30 Dec 2007 04:54
That's my answear(1068):
var
   s,a,i:integer;
begin
   read(a);
   s:=0;
   for i:=a to 1 do
      s:=s+i;
   for i:=1 to a do
      s:=s+i;
   write(s);
end.
What is wrong??? I think it's true...
Re: Please, help... Wrong answear...
Posted by Chmel_Tolstiy 30 Dec 2007 15:18
try a = 1; :)
Happy New Year !!!
Re: Please, help... Wrong answear...
Posted by DELETED 8 Feb 2008 22:40
My program looks the same and I got WA too but I used IF and ELSE and your cycle works twice thats why it is wrong!

Edited by author 08.02.2008 22:41


Edited by author 08.02.2008 22:41

Edited by author 08.02.2008 22:41