Run ID:1690

提交时间:2023-11-04 16:57:41

# include<iostream> using namespace std; int main() { int n, m = 0; cin>>n; for(int i = 1; i <= 2*n - 1; i++) { if(i <= n) { m++; } else { m--; } for(int j = 1; j <= n - m; j++) { cout<<' '; } for(int j = 1; j <= m; j++) { cout<<j; } for(int j = m-1; j >= 1; j--) { cout<<j; } cout<<' '<<endl; } return 0; }