Pagini recente » Cod sursa (job #261041) | Cod sursa (job #1362079) | Statistici wqeqwe (theodortuduran) | Cod sursa (job #1569255) | Cod sursa (job #1769)
Cod sursa(job #1769)
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.