Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
109183 | 彭士宝 | 打印直角三角形 | C++ | Wrong Answer | 1 MS | 268 KB | 445 | 2025-02-05 21:23:32 |
#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 k = 1; k <= 2 * i - 1; ++k) { cout << "*"; } cout <<endl; // 每行结束后换行 } return 0; }
------Input------
7
------Answer-----
* ** *** **** ***** ****** *******
------Your output-----
* *** ***** ******* ********* *********** *************