SHARE
TWEET

Untitled

a guest Jun 19th, 2019 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <stdio.h>
  2.  
  3. int fat (int i)
  4. {
  5.     if (i == 1 || i == 0)
  6.     {
  7.         printf("1\n");
  8.     }
  9.     return i * fat (i - 1);
  10. }
  11.  
  12. void calculo (int num, int i)
  13. {
  14.     if (num == 1)
  15.     {
  16.         printf("%d\n", fat (i));
  17.         return;
  18.     }
  19.     calculo (num / 3, i + 1);
  20. }
  21.  
  22. void loop (int num, int i)
  23. {
  24.     if (num == 1)
  25.     {
  26.         printf("1\n");
  27.     }
  28.     calculo (num, 0);
  29. }
  30.  
  31. int main()
  32. {
  33.     int num, i;
  34.     scanf("%d", &num);
  35.     loop (num, i);
  36.     return 0;
  37. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top