Pagini recente » Cod sursa (job #1001551) | Cod sursa (job #2233412) | Cod sursa (job #966929) | Cod sursa (job #2861009) | Cod sursa (job #1766)
Cod sursa(job #1766)
var x,y,u,n,i,j,k:integer;
begin
assign(input,'fractii.in');
reset(input);
read(input,n); close(input); k:=sqr(n);
for i:=1 to n do
for j:=1 to n do
begin
x:=i;y:=j;
for u:=2 to n do begin
while x<>y do
begin
if x>y then x:=x-y
else y:=y-x;
end;
if x=u then k:=k-1;end;
end;
assign(output,'fractii.out');
rewrite(output);
write(output,k);
close(output);
end.