|
|
back to boardwhi wrang help me please it is all good in formul var q,i,j,k,l,m,n,b:longint; v:integer; a:array [1..200000] of longint; x:real; s,s1:string; begin readln (n); for i:=1 to n do begin readln (j); x:=sqrt(1+8*(j-1)); str(x,s); for m:=2 to length(s) do begin if (s[m]='.')and(k<>1) then k:=1 else s1:=s1+s[m]; if k=1 then break; end; k:=0; inc(q); val (s1,b,v); if b*b=(1+8*(j-1)) then k:=1; if k=0 then a[q]:=0 else a[q]:=1;; k:=0; s1:=''; end; writeln; write(a[1],' '); for i:=2 to q do write(' ',a[i],' '); end. Re: whi wrang help me please it is all good in formul 0+1+2+...+N=N*(N+1)/2 - it's a very easy!!! |
|
|