Pagini recente » Cod sursa (job #2564380) | Cod sursa (job #3248491) | Cod sursa (job #3001272) | Cod sursa (job #2523107) | Cod sursa (job #2442955)
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 and a=1 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.