#include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { // 打印空格 for (int j = 0; j < n - i; j++) { cout << " "; } // 打印数字 for (int k = 0; k < 2 * i - 1; k++) { cout << k + 1; } cout << endl; } return 0; } /************************************************************** Problem: 1072 User: linmiaoling Language: C++ Result: Accepted Time:7 ms Memory:2072 kb ****************************************************************/