Pagini recente » Cod sursa (job #2483979) | Cod sursa (job #3136380) | Cod sursa (job #2836448) | Cod sursa (job #2963891) | Cod sursa (job #2443349)
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);
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);
end;
rewrite(out_f);
write(out_f, f);
close(out_f);
end.