Mai intai trebuie sa te autentifici.
Cod sursa(job #1769)
Utilizator | Data | 14 decembrie 2006 18:40:30 | |
---|---|---|---|
Problema | Fractii | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
var x,y,u,n,i,j,k:integer;
begin
assign(input,'fractii.in');
reset(input);
read(input,n); close(input); k:=sqr(n);
for i:=1 to n do
for j:=1 to n do
begin
x:=i;y:=j;
for u:=2 to n do begin
while x<>y do
begin
if x>y then x:=x-y
else y:=y-x;
end;
if x=u then k:=k-1;end;
end;
assign(output,'fractii.out');
rewrite(output);
write(output,k);
close(output);
end.