hdu 2502
1083 단어 규칙 을 찾다
#include <iostream>
using namespace std;
int main()
{
int t,n;
cin>>t;
while(t--)
{
cin>>n;
int ans=(n-1)*(1<<(n-2))+(1<<(n-1));
cout<<ans<<endl;
}
return 0;
}
Menu
#include <iostream>
using namespace std;
int main()
{
int t,n;
cin>>t;
while(t--)
{
cin>>n;
int ans=(n-1)*(1<<(n-2))+(1<<(n-1));
cout<<ans<<endl;
}
return 0;
}