Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
117887 彭士宝 数字金字塔 C++ Accepted 1 MS 272 KB 405 2025-04-20 16:57:05

Tests(8/8):


Code:

#include <iostream> using namespace std; int main() { int n; cin >> n; for (int i = 1; i <= n; i++) { // 打印空格 for (int j = 1; j <= n - i; j++) { cout << " "; } // 打印数字 for (int j = 1; j <= 2 * i - 1; j++) { cout << i; } // 换行 cout << endl; } return 0; }