Cod sursa(job #519954)

Utilizator autoplayerBerendea autoplayer Data 6 ianuarie 2011 23:08:15
Problema Fractii Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.42 kb
var n,i,s : longint;
    t : text;

function ver(i,n : longint):boolean;
begin
if i=1 then ver:=true
else if n=1 then ver:=true
else if n mod i=0 then ver:=false
else if i mod n=0 then ver:=false
else ver:=true;
end;

begin
assign(t,'fractii.in');reset(t);
readln(t,n);close(t);
assign(t,'fractii.out');rewrite(t);
for i:=1 to n do
   for n:=1 to n do if ver(i,n)
   then inc(s);
writeln(t,s);
close(t);
end.