fork download
  1. #include <stdio.h>
  2.  
  3. int sum(int n){
  4. if(n>9){
  5. return sum(n/10)+n%10;
  6. }else{
  7. return n;
  8. }
  9. }
  10. int main(void) {
  11. int num=1729;
  12. printf("%d",sum(num));
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0s 5284KB
stdin
Standard input is empty
stdout
19