#include <bits/stdc++.h> //头文件 using namespace std; //命名空间 int main() //主函数,程序入口 { int a[17]={0},sum=0; a[1]=1; sum=a[1]; for(int i=2;i<=16;i++) { //a[i]=pow(2,i-1); a[i]=a[i-1]*2; sum=sum+a[i]; } cout<<sum; return 0; //程序结束,返回 }
By signing up a 羽润编程 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 羽润编程 universal account