repo.or.cz
/
furry-nemesis.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
cloned from srcbox.
[furry-nemesis.git]
/
tyvj
/
tyvj1022.pas
blob
8b2d2e59315ee34163c72225d601801a36f3da47
1
var
2
n
,
i
,
k
:
longint
;
3
a
:
array
[
1
.
.1000000
]
of
integer
;
4
5
begin
6
readln
(
n
);
7
if
n
=
0
then begin
write
(
0
);
halt
;
end
;
8
while
n
<>
0
do
9
begin
10
inc
(
k
);
11
a
[
k
]:=
n
mod
(-
2
);
12
n
:=
n
div
(-
2
);
13
if
a
[
k
]<
0
then
14
begin
15
inc
(
a
[
k
],
2
);
16
inc
(
n
);
17
end
;
18
end
;
19
for
i
:=
k
downto
1
do
write
(
a
[
i
]);
20
end
.