Pagini recente » Diferente pentru teorema-chineza-a-resturilor intre reviziile 45 si 44 | Cod sursa (job #9436) | Cod sursa (job #1411466) | Cod sursa (job #1201086) | Cod sursa (job #704784)
Cod sursa(job #704784)
program fractii;
var f,g:text;
i,j,x,y,n,r,nr:longint;
begin
assign (f,'fractii.in'); reset (f);
assign (g,'fractii.out'); rewrite (g);
read (f,n);
nr:=0;
for i:=1 to n do
for j:=1 to n do begin x:=i;
y:=j;
while (y<>0) do begin r:=x mod y;
x:=y;
y:=r;
end;
if (x=1) then nr:=nr+1;
end;
write (g,nr);
close (f);
close (g);
end.