Pagini recente » Cod sursa (job #2534319) | Cod sursa (job #687392) | Cod sursa (job #1824406) | Cod sursa (job #1368885) | Cod sursa (job #2313856)
program cc; type tabel=array[1..1000000]of 0..1;
var a,i,x,y,n,b,max,min,m,j:longint; t:tabel;
begin
assign(input,'fractii.in');assign(output,'fractii.out');reset(input);
rewrite(output);
readln(n);
b:=n+n-1;
for i:=2 to n do
for j:=2 to n do begin
x:=i;y:=j;
while x<>0 do begin
a:=x;
x:=y mod x;
y:=a;end;
if y=1 then inc(b);
end;
write(b);
close(input); close(output);
end.