Cod sursa(job #1995)
Utilizator | Data | 15 decembrie 2006 16:32:35 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
program fractii;
var n,k,i,j,r,d,e:longint;f1,f2:text;
begin
assign(f1,'fractii.in');
reset(f1);
read(f1,n);
close(f1);
k:=0;
for i:=1 to n do
for j:=1 to n do
begin
repeat
d:=i;
e:=j ;
r:=d mod e;
d:=e;
e:=r;
until r=0;
if d=1 then k:=k+1;
end;
assign(f2,'fractii.out') ;
rewrite(f2);
write(f2,k);
close(f2);
end.