Bài 1:
Code:
const
MAX=1000;
type
kieuluoi=array[1..MAX] of integer;
var luoi:kieuluoi;
n,k,m,i:integer;
s:integer;
procedure bosoi;
var i:integer;
begin
if n>=1 then
begin
inc(luoi[1]);
s:=luoi[1];
if n>=2 then
begin
inc(luoi[2]);
inc(s,luoi[2]);
if n>2 then
for i:=3 to n do
begin
inc(luoi[i],s);
inc(s,luoi[i])
end
end
end
end;
begin
readln(n,k,m);
if m > n then
writeln('m phai nho hon n')
else
begin
for i:=1 to n do
luoi[i]:=0;
for i:=1 to k do
bosoi;
write(luoi[m]);
readln
end;
end.