Pagini recente » Cod sursa (job #1869576) | Cod sursa (job #2132534) | Cod sursa (job #2404264) | Cod sursa (job #633657) | Cod sursa (job #580865)
Cod sursa(job #580865)
program fractii;
type matrice=array[0..10000,0..10000] of 0..1;
var n,i,j,x,y,t:longint;
a:matrice;
d,o:text;
function max(a,b:longint):longint;
begin
if a>b then max:=a else max:=b;
end;
begin
assign(d,'fractii.in');assign(o,'fractii.out');
reset(d);rewrite(o);
read(d,n);t:=0;
for i:=1 to n do
for j:=1 to n do
if a[i,j]=1 then
begin
t:=t+1;
x:=i;y:=j;
while (x<=n)and(y<=n) do
begin
a[x,y]:=1;
x:=x+i;y:=y+j;
end;
end;
writeln(o,t);
close(d);
close(o);
end.