#include <stdlib.h>#include <iostream>using namespace std;int arrSum(int arr[],int n){if(n!=0)return arr[n-1] + arrSum(arr,n-1);return 0;//return n==0?0:(arr[n-1] + arrSum(arr,n-1));}void main(){int arr[] = {1,2,3,4,5};int len=sizeof(arr)/sizeof(arr[0]);cout<<arrSum(arr,len)<<endl; system(\公众pause\"大众);}//15
-End-