program proga;
var
f1, f2: text;
a: integer;
i: integer;
s: string = '';
begin
assign(f1, 'file1.csv');
reset(f1);
read(f1, a);
close(f1);
for i := 0 to 31 do // integer = 32 бит
if a and (1 shl i) > 0 then
if a >= 0 then
s := '1' + s
else
s := '0' + s
else if a >= 0 then
s := '0' + s
else
s := '1' + s;
assign(f2, 'file2.csv');
rewrite(f2);
write(f2, s);
close(f2);
end.
program primer;
var f1,f2:text;
a,b:integer;
I,n:integer;
S:string;
procedure F(a,b:integer; flag:integer);
begin
if flag = 1 then
if a < 0 then begin
a:=a*(-1);
writeln (f2, '1') ;
end
else writeln (f2, '0');
end;
begin
Assign(f1, 'file1.txt');
Reset(f1);
while not eof(f1) do
Readln(f1);
if b <> 0 then
while (a div b) > 0 do begin
a:= a mod b;
end;
Assign(f2, 'file2.txt');
Rewrite(f2);
write(a);
writeln(f2);
close (f1);
close (f2);
end.