题解:n=1为基础,递归思想
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;
int n;
void deal(int x,int temp)
{
if(x==1)
{
printf("FD 1/%d\n",temp);
printf("LD 60\n");
printf("FD 1/%d\n",temp);
printf("LD 240\n");
printf("FD 1/%d\n",temp);
printf("LD 60\n");
printf("FD 1/%d\n",temp);
}
else
{
deal(x-1,temp);
printf("LD 60\n");
deal(x-1,temp);
printf("LD 240\n");
deal(x-1,temp);
printf("LD 60\n");
deal(x-1,temp);
}
}
int main()
{
cin>>n;
int temp=pow(3,n);
if(n==0)
printf("FD 1/1\n");
else
deal(n,temp);
return 0;
}