Run ID:160601
提交时间:2026-09-24 19:06:49
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; int z = n; for(int i = n; i >= 1; i--) { // 打印 2*i-2 个空格,正向循环 for(int j = 1; j <= 2*i - 2; j++) { cout << ' '; } for(int j = 1; j <= z; j++) { cout << '*'; } cout << '\n'; // 把endl换成'\n' z += 2; } return 0; }