Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const fi='BCSINH.inp';
- fo='BCSINH.out';
- var n, i: longint;
- x: array [1..30] of longint;
- begin
- assign(input, fi); reset(input);
- assign(output, fo); rewrite(output);
- readln(n);
- fillchar(x, sizeof(x), 0); i:=1;
- while i<>0 do
- begin
- for i:=1 to n do write(x[i]); writeln;
- i:=n;
- while (i>0) and (x[i]=1) do dec(i);
- if i>0 then
- begin
- x[i]:=1;
- fillchar(x[i+1], (n-i)*sizeof(x[1]), 0);
- end;
- end;
- close(input); close(output);
- end.
Advertisement
Add Comment
Please, Sign In to add comment