Pagini recente » Istoria paginii utilizator/arteni_cristi | Istoria paginii runda/testfinal/clasament | Profil Otter404 | Monitorul de evaluare | Cod sursa (job #299086)
Cod sursa(job #299086)
var n,i,j,x,y,nr,r:longint;
begin
assign (input,'fractii.in');
reset (input);
assign (output,'fractii.out');
rewrite (output);
readln (n);
nr:=n;
for i:=2 to n do
for j:=1 to n do
begin
if j=1 then inc (nr)
else begin
x:=i;
y:=j;
while y<>0 do
begin
r:=x mod y;
x:=y;
y:=r;
end;
if x=1 then inc(nr);
end;
end;
writeln (nr);
end.