Pagini recente » Cod sursa (job #718766) | Cod sursa (job #2959879) | Cod sursa (job #1946154) | Cod sursa (job #2153460) | Cod sursa (job #4984)
Cod sursa(job #4984)
var n,i,j:longint;
f,g:text;
nr:integer;
function cmmdc(x,y:longint):longint;
begin
while y<>0 do
begin
if x>y then x:=x-y
else y:=y-x;
end;
cmmdc:=x;
end;
begin
assign(f,'fractii.in');reset(f);
assign(g,'fractii.out');rewrite(g);
read(f,n);
for i:=1 to n do
for j:=1 to n do
begin
if cmmdc(i,j)=1 then inc(nr);
end;
write(g,nr);
close(F);close(g);
end.