| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160609 | Kevin | 输出梯形 | C++ | Accepted | 2 MS | 272 KB | 508 | 2026-09-24 19:11:58 |
#include<iostream> using namespace std; int main() { int h; //关键:while循环持续读入,处理多组样例! while(cin >> h) { int space = 2*(h-1); int star = h; for(int i=0; i<h; i++) { for(int j=0; j<space; j++) cout << ' '; for(int j=0; j<star; j++) cout << '*'; cout << '\n'; space -= 2; star += 2; } } return 0; }