Run ID 作者 问题 语言 测评结果 分数 时间 内存 代码长度 提交时间
105191 陈致钧 棋子移动 C++ 解答错误 20 0 MS 248 KB 380 2023-10-05 11:24:53

Tests(1/5):


#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; } }


测评信息: