program penjmlhn_sgtgapascal;
uses wincrt;
var
n,m,i,a,b,c:longint;
d,e:real;
begin
write('input: ');readln(n);
for m:=0 to n do
begin
a:=1;b:=1;c:=1;
for i:=1 to n do
a:=a*i;
for i:=1 to n-m do
b:=b*i;
for i:=1 to m do
c:=c*i;
begin
d:=a/(b*c);
e:=e+d;
if n=m then
write(d:0:0)
else
write(d:0:0,'+');
end;
end;
write('=',e:0:0);
end.
0 komentar:
Posting Komentar