Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
85763 梁敖铭 拐角方阵 C++ Presentation Error 1 MS 272 KB 337 2024-07-20 15:27:15

Tests(0/2):


Code:

#include<iostream> #include<string> #include<algorithm> using namespace std; int main() { int n,i,j,ji; cin >> n; for(i = 1;i <= n;i++) { ji = i; for(j = 1;j < ji;j++) { printf("%5d",j); } for(j = ji;j <= n;j++) { printf("%5d",ji); } if(i != n) { cout << endl; } } return 0; }