Run ID:160605

提交时间:2026-09-24 19:09:32

#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++) { string line; // 空格 line += string(2*(h-1-k), ' '); // 星号 line += string(h + 2*k, '*'); if(k != h-1) line += '\n'; cout << line; } return 0; }