一道C#递归的面试题

通过递归计算数组a[100]的前n个数之和。

int Sum(int[] a,int n)
{
     if(n>0)
  {
      return a[n-1]+Sum(a,n-1);
   }
  else
     return 0;
}
sometimes the hardest part isn't letting go,but rather start over
原文地址:https://www.cnblogs.com/zhumeiming/p/4402313.html