提交时间:2023-10-05 11:11:25
运行 ID: 105158
#include <bits/stdc++.h> using namespace std; int a[1005]; int f(int k) { if(k==4) { cout<<"4,5-->9,10\n8,9-->4,5\n2,3-->8,9\n7,8-->2,3\n1,2-->7,8"; } else { cout<<k<<","<<k+1<<"-->"<<2*k+1<<","<<2*k+2; cout<<"\n"<<2*k+1<<","<<2*k<<"-->"<<k<<","<<k+1<<endl; return f(k-1); } } int main() { int n; cin>>n; f(n); return 0; }