C语言:蟠桃
#include <stdio.h> main() { int days,sum=1; scanf("%d",&days); while(--days) { sum=(sum+1)*2; } printf("%d",sum); getchar(); }
#include <stdio.h> int f(int n){ if(n==1) return 1; else return 2*(f(n-1)+1); } main() { int n,a,b,c; scanf("%d",&n); b=f(n); printf("%d",b); getchar(); }