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