代码如下:#includeusingnamespacestd;intsum(intn){if(n==0)return0;returnn+sum(n-1);}voidmain(){cout<}不知道有没帮到你望采纳