解析: 汉诺塔挪n个盘,最少要挪2^k-1次
由此可得代码:
#include<iostream> using namespace std; int main(){ int n; cin>>n; cout<<pow(2,n)-1; }
使用您的 NWOJ 通用账户