Pagini recente » Cod sursa (job #489859) | Cod sursa (job #1515292) | Cod sursa (job #456103) | Cod sursa (job #371002)
Cod sursa(job #371002)
program fractii;
uses crt;
var f:text;
i,j,nr,n:longint;
begin
assign(f,'fractii.in');
reset(f);
readln(f,n);
close(f);
assign(f,'fractii.out');
rewrite(f);
nr:=1;
for i:=1 to n do
for j:=1 to n do
begin
if (j>i)and((((j mod 2<>0)and(i mod 2=0))or((j mod 2=0)and(i mod 2<>0))or((j mod 2=i mod 2)and(j/i<>0)))or(i=1))then
nr:=nr+1;
if (i>j)and((((j mod 2<>0)and(i mod 2=0))or((j mod 2=0)and(i mod 2<>0))or((i/2=j/2)and(i/j<>0)))or(j=1))then
nr:=nr+1;
end;
writeln(f,nr);
close(f);
end.