题解 | #反斜线形图案#
反斜线形图案
https://www.nowcoder.com/practice/7b066963c4eb4d188becd18c37dfe22d
#include<iostream>
using namespace std;
int main()
{
int k;
while (cin >> k)
{
for (int i = 0; i < k; i++)
{
cout << string(i, ' ') << "*" << endl;
}
}
return 0;
}

查看12道真题和解析