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

(Pascal) well... I don't see any mistakes ._.
Posted by [nkfi]_FaZz 12 Jan 2012 16:49
 var N,X:integer;
 begin
 readln(N);
 if N>0 then
 X:=round((1+N)*N/2);
 if N<0 then
 X:=round((1+N)*(abs(N)+2)/2);
 writeln(X);
 end.
Re: (Pascal) well... I don't see any mistakes ._.
Posted by ilya7400 17 Jan 2012 22:53
попробуйте ввести 0 оно выводит 0 хотя от 0 до 1 если включительно то ответ должен быть 1
Re: (Pascal) well... I don't see any mistakes ._.
Posted by Mokuji 10 Dec 2012 01:10


Edited by author 10.12.2012 01:14