Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3. while(1)
  4. {
  5. int tab[10000];
  6. int b, c, q, w;
  7.  
  8. int rec( int w){
  9. if(w>0)
  10. return w%10 + rec(w/10);
  11. return 0;
  12. }
  13. int it(int q){
  14. b=0;
  15. while(q !=0){
  16. b += q%10;
  17. q /= 10;
  18. }
  19. return b;
  20. }
  21.  
  22. aaa:
  23. scanf("%d", &tab[c]);
  24. printf("%d, ", it(tab[c]));
  25. printf("%d\n", rec(tab[c]));
  26. if(main==1) goto aaa;
  27.  
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement