|
|
back to boardHelp me Var i,n :byte; a,b,k: longint; t: array [1..44] of byte; Begin readln(input,n,k); Dec(k); while (k>0) do begin a:= 1; b:= 2; i:= 1; if (k=a) then t[1]:= 1; if (k=b) then t[2]:= 1; if ((k=a) or (k=b)) then begin k:= 0; break; end; Repeat Inc(i); Inc(a,b); if (a> k) then break; Inc(i); Inc(b,a); until (b> k); if (b>a) then b:= a; t[i]:= 1; Dec(k,b); if (i>n) then break; end; for k:= n downto 1 do write(output,t[k]); End. |
|
|