Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
110301 | 陈铎文 | 打印数字图形 | C++ | Accepted | 1 MS | 280 KB | 486 | 2025-02-16 09:23:23 |
#include<bits/stdc++.h> using namespace std; int main() { int n; int h; cin>>n; for(int i=1;i<=n;i++){ for(int j=1;j<=n-i;j++){ cout<<" "; } for(int k=1;k<=i;k++){ cout<<k; } for(int m=i-1;m>=1;m--){ cout<<m; } cout<<endl; } for(int i=n-1;i>=1;i--){ for(int j=1;j<=n-i;j++){ cout<<" "; } for(int k=1;k<=i;k++){ cout<<k; } for(int m=i-1;m>=1;m--){ cout<<m; } cout<<endl; } return 0; }