#include <stdio.h>
int main()
{int n,i,sum=1;scanf("%d",&n);for(i=n-1; i>=1; i--){sum=(sum+1)*2;}printf("%d",sum);return 0;
}
详细解决方案
【1354】猴子吃桃
热度:25 发布时间:2023-12-06 10:00:13.0
#include <stdio.h>
int main()
{int n,i,sum=1;scanf("%d",&n);for(i=n-1; i>=1; i--){sum=(sum+1)*2;}printf("%d",sum);return 0;
}