提交时间:2023-10-05 11:24:53
运行 ID: 105191
#include<bits/stdc++.h> using namespace std; int main() { int num;cin>>num; int n=num; int m=0; cout<<n<<","<<n+1<<"-->"<<n*2+1<<","<<(n+1)*2<<endl; for(int i=2;i<=(num-1)*2-1;i++) { if(i>=4&&!(i%2)) m++; if(!(i%2)) cout<<n*2-m<<","<<n*2+1-m<<"-->"<<n-2*m<<","<<n+1-2*m<<endl; else cout<<n/2-m<<","<<n/2+1-m<<"-->"<<n*2-m<<","<<n*2+1-m<<endl; } }