Pagini recente » Cod sursa (job #1982220) | Cod sursa (job #845464) | Cod sursa (job #50372) | Cod sursa (job #2068322) | Cod sursa (job #2442956)
program fractii;
var n,i,f,j,a,b,temp:longint;
in_f,out_f:text;
begin
assign(in_f,'fractii.in');
assign(out_f,'fractii.out');
reset(in_f);
rewrite(out_f);
readln(in_f,n);
for i:=1 to n do
for j:=1 to n do
begin
b := j;
a:=i;
while (b <> 0) do
begin
temp := b;
b := a mod b;
a := temp;
end;
if a= 1 then inc(f);
// write(a);
end;
// then inc(f);
write(out_f,f);
close(out_f);
end.