题解

麦睿生  •  3个月前


#include<bits/stdc++.h>
using namespace std;
void Move(int k)
{
	if(k==4)
	{
		cout<<"4,5-->9,10"<<endl;
		cout<<"8,9-->4,5"<<endl;
		cout<<"2,3-->8,9"<<endl;
		cout<<"7,8-->2,3"<<endl;
		cout<<"1,2-->7,8"<<endl;
	} 
	else
	{
		cout<<k<<','<<k+1<<"-->"<<2*k+1<<','<<2*k+2<<endl;
		cout<<2*k-1<<','<<2*k<<"-->"<<k<<','<<k+1<<endl;
		Move(k-1);
	}
}
int main()
{
	int N;
	cin>>N;
	Move(N);
	return 0;
}

评论: