题目 答案 int sum( int n ) { if(n<0) return 0; if(n==0) return 0; if(n==1) return 1; else return n+sum(n-1); } 注意 在考试时一定要多考虑一下特殊情况,切记切记!