1058怎么错了?

lixinyan 爱因斯坦 2024-03-09 16:59:23 2024-03-09 17:00:19 4

#include 《iostream》

using namespace std;

int main() {

int n;

char a = '*';

cin >> n;

for (int i = 1; i <= n; i++) {

    for (int j = 1; j <= n + i; j++) {

        cout << " ";
    }
    for (int f = 1; f <= i; f++) cout << a << " ";

    cout << "\n";

}
return 0;

}

{{ vote && vote.total.up }}

共 1 条回复

Brilliance 紫罗兰

前空格打的不对 *之间不能加空格