| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 160604 | Kevin | 输出梯形 | C++ | Wrong Answer | 1 MS | 284 KB | 575 | 2026-09-24 19:09:14 |
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(0); int h; cin >> h; for(int k = 0; k < h; k++) { //打印空格 for(int s = 0; s < 2*(h - 1 - k); s++) { cout << ' '; } //打印星 for(int star = 0; star < h + 2*k; star++) { cout << '*'; } // 只有不是最后一行,才输出换行! if(k != h - 1) { cout << '\n'; } } return 0; }
------Input------
1 2 3 4 5 6 7 8 9 10 20 50 100
------Answer-----
* ** **** *** ***** ******* **** ****** ******** ********** ***** ******* ********* *********** ************* ****** ******** ********** ************ ************** **************** ******* ********* *********** ************* *************** ***************** ******************* ******** ********** ************ ************** **********
------Your output-----
*