codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
int additive_helper(int n, int count) { if(n<9) { return count; } else { return additive_helper(sum(digit(n)), count + 1); } } int additive(int n) { return additive_helper(n, 0); }
Private
[
?
]
Run code
Submit