Run ID:160602
提交时间:2026-09-24 19:07:45
#include<bits/stdc++.h> using namespace std; int main() { int h; cin >> h; for(int k = 0; k < h; k++) { //打印空格:2*(h-1-k) 个 for(int s = 0; s < 2*(h - 1 - k); s++) { cout << ' '; } //打印星号:h + 2*k 个 for(int star = 0; star < h + 2*k; star++) { cout << '*'; } cout << '\n'; } return 0; }