Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Why wa>program qiuhe; var n,delta,i,x,t:integer; begin readln(n); delta:=round(sqrt(8*n+1)); x:=round((delta-1)/2);i:=(x*x+x) div 2; if i=n then writeln(x) else begin repeat x:=x+1; i:=i+x; until (i>n) and (not odd(i-n)); writeln(x); end; end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator