用递归方法求1―100的和

2025-04-07 21:42:33
推荐回答(1个)
回答1:

我不清楚用什么语言,所以用伪代码:

定义函数sum(fin)
{
if(fin==0)
{return 0}
else{ return fin+sum(fin-1)
}