Cod sursa(job #2313856)
Utilizator | Data | 7 ianuarie 2019 15:35:57 | |
---|---|---|---|
Problema | Fractii | Scor | 10 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.42 kb |
program cc; type tabel=array[1..1000000]of 0..1;
var a,i,x,y,n,b,max,min,m,j:longint; t:tabel;
begin
assign(input,'fractii.in');assign(output,'fractii.out');reset(input);
rewrite(output);
readln(n);
b:=n+n-1;
for i:=2 to n do
for j:=2 to n do begin
x:=i;y:=j;
while x<>0 do begin
a:=x;
x:=y mod x;
y:=a;end;
if y=1 then inc(b);
end;
write(b);
close(input); close(output);
end.