1个回答
展开全部
{第1题} program elyt1; var s:longint; x,n:integer; function ncimi(x,n:integer):longint; var t:longint; begin if n=1 then t:=x else t:=x*ncimi(x,n-1); ncimi:=t; end; begin write('x='); readln(x); write('n='); readln(n); s:=ncimi(x,n); writeln(x,'^',n,'=',s); readln end. {第2题} program elyt2; var s:longint; i:integer; function jiecheng(n:integer):longint; var t:longint; begin if n=1 then t:=1 else t:=n*jiecheng(n-1); jiecheng:=t; end; begin s:=0; for i:=1 to 7 do s:=s+jiecheng(i); writeln('1!+2!+3!+4!+5!+6!+7! =',s); end.
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询