
3个回答
展开全部
program plus(input,output);
var
s,a:dword;
function plus(n:word):dword;
begin
if n<>1 then begin
for a:=1 to n do
s:=s+a;
plus(n-1);
end;
end;
begin
s:=0;
readln(n);
plus(n);
writeln(s);
end.
此乃递归,我没有检查,如果有小问题请见谅
var
s,a:dword;
function plus(n:word):dword;
begin
if n<>1 then begin
for a:=1 to n do
s:=s+a;
plus(n-1);
end;
end;
begin
s:=0;
readln(n);
plus(n);
writeln(s);
end.
此乃递归,我没有检查,如果有小问题请见谅
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
#include <stdio.h>
void main()
{
int n;
scanf("%d",&n);
while(n>0)
{ s=(n+1)n/2;
n=n--;
s+=s;
}
printf("%d\n",s)
}
应该是对的吧 我只会C 不知道能帮到你不
void main()
{
int n;
scanf("%d",&n);
while(n>0)
{ s=(n+1)n/2;
n=n--;
s+=s;
}
printf("%d\n",s)
}
应该是对的吧 我只会C 不知道能帮到你不
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
s=1 for i=1 to 20 t=0 for j=1 to i t=t+j next j s=s*t next i print s
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询