Pagini recente » Cod sursa (job #439571) | Cod sursa (job #1421957) | Cod sursa (job #2385828) | Cod sursa (job #2926942) | Cod sursa (job #2442954)
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.