Pagini recente » Clasament oni.2015.1112.bv.4 | Cod sursa (job #1744577) | Cod sursa (job #1445780) | Cod sursa (job #2160669) | Cod sursa (job #30098)
Cod sursa(job #30098)
{$ASMMODE intel}
var a,i,j,c:longint;
f:text;
function lnko(a,b:longint):longint;assembler;
asm
push eax
push edx
shr eax,1
jc @ize
shr edx,1
jc @ize
pop edx
pop eax
mov eax,2
jmp @kii
@ize:
pop edx
pop eax
@ciklus:
cmp eax,edx
jb @kisebb
sub eax,edx
jmp @vege
@kisebb:
sub edx,eax
@vege:
cmp eax,0
je @na
cmp edx,0
je @kii
cmp eax,edx
jne @ciklus
jmp @kii
@na:
xchg eax,edx
@kii:
end;
begin
assign(f,'fractii.in');
reset(f);
read(f,a);
close(f);
c:=a*2-1;
for i:=2 to a do
for j:=2 to a do
if lnko(i,j)=1 then inc(c);
assign(f,'fractii.out');
rewrite(f);
write(f,c);
close(f);
end.