#include <iostream>
#include <stdlib.h>
using namespace std;
void Move(int n, char A, char B, char C)
{
if (n == 1)
{
cout << "Move disk " << n << " from " << A << " to " << C << endl;
}
else
{
Move(n - 1, A, C, B);
cout << "Move disk " << n << " from " << A << " to " << C << endl;
Move(n - 1, B, A, C);
}
}
void Hanoi(int n)
{
if (n <= 0)
return;
Move(n, 'A', 'B', 'C');
}
int main()
{
int x;
cin >> x;
Hanoi(x);
int f[1000]={0,1};
for(int i=2;i<=x;i++)
f[i]=2*f[i-1]+1;
cout<<f[x]<<endl;
system("pause");
return 0;
}
请问:main函数里的f【x】数组以及for循环是什么意思?