fork download
  1. #include <stdio.h>
  2. int Summa(long long int a){
  3. static long long int m,n;
  4. long long int c,g;
  5. n++;
  6. c=a%10;
  7. a=a/10;
  8. m=m+c;
  9. if (a==0){
  10. m=m-n;
  11. return m ;
  12. }
  13. g=Summa(a);
  14.  
  15. return m;
  16. }
  17.  
  18.  
  19. int main() {
  20. long long int a,b;
  21. scanf("%lld",&a);
  22. b = Summa(a);
  23. printf("%lld",b);
  24. return 0;
  25. }
  26.  
Success #stdin #stdout 0s 4296KB
stdin
91232193
stdout
22