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 1209. 1, 10, 100, 1000...

What's wrong?(pascal)
Posted by Jumbo 19 Mar 2011 23:52
var n,a,i,x,k:integer;

begin
readln(n);

for i:=1 to n do begin
 readln(a);
  x:=1;
  k:=1;
  repeat
  x:=x+k;
  k:=k+1;
  until a-x<=0;
  if a=x then write('1',' ') else write('0',' ');
end;

end.
Re: What's wrong?(pascal)
Posted by Valentinez Alkalinella Xifax 1 Jul 2011 16:45


Edited by author 01.07.2011 16:46