#include<iostream.h>
int rek(int i) {
double s=0.9;
if (i)
s+= rek (i/10)+i%10;
return int (s+0.5);
}
int main () {
cout << rek (1234);
}
We have test. This is one of the question from last year. My question is:
From where is solution/result: 15??
I'm beginning, where main () is, und rek(1234) goes to the top, where rek (int i).
And then came if (i) or if (1234). Is it now one recursion, and how it goes on?