fork download
  1. #include <stdio.h>
  2.  
  3. int a(int n)
  4. {
  5. if (n == 1)
  6. return 1;
  7. else
  8. return 2 * a(n - 1) + 2;
  9. }
  10.  
  11. int main()
  12. {
  13. printf("答えは:%d\n", a(4));
  14. return 0;
  15. }
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
答えは:22