You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
#include<iostream>
|
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
void HN(int n, char A, char B, char C)
|
|
|
|
|
{
|
|
|
|
|
if (n == 1)
|
|
|
|
|
{ //<2F><>ʼλ<CABC><CEBB>ֻʣ<D6BB><CAA3>һ<EFBFBD><D2BB>ʱ<EFBFBD><CAB1>ֱ<EFBFBD><D6B1><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>Ŀ<EFBFBD>ĵأ<C4B5><D8A3>ڶ<EFBFBD><DAB6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>C<EFBFBD><43>
|
|
|
|
|
cout << A << "->" << C << endl;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
HN(n - 1, A, C, B); //<2F><>A<EFBFBD><41><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD>תΪC<CEAA><43><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>B <20><><EFBFBD><EFBFBD><EFBFBD>ǵ<EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>B<EFBFBD><42>
|
|
|
|
|
cout << A << "->" << C << endl;
|
|
|
|
|
HN(n - 1, B, A, C); //<2F><>B<EFBFBD><42><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӣ<EFBFBD><D3A3><EFBFBD>תΪA<CEAA><41><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>C<EFBFBD><43><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>B<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƶ<EFBFBD><C6B6><EFBFBD>C<EFBFBD><43>
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
int n;
|
|
|
|
|
cout << "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>A<EFBFBD><EFBFBD><EFBFBD>м<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD>źõĵ<EFBFBD><EFBFBD>ӣ<EFBFBD>";
|
|
|
|
|
cin >> n;
|
|
|
|
|
cout << "<EFBFBD>ƶ<EFBFBD>˳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>\n";
|
|
|
|
|
HN(n, 'A', 'B', 'C');
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|