CodePudding user response:
Give you a sampleint gcount=0;
Long long getp (int n) {
Gcount++;
If (n<1) return 1;
Else if (n==1) return 7;
Else if (n==2) return 11;
Return getp getp (n - 1) + (n - 2);//here is called recursive twice, so low efficiency
}
Int main () {
int n;
The scanf (" % d ", & amp; N);
Getp (n);
Printf (" % d \ n ", gcount);
return 0;
}