*
***输入
一个整数n
输出
输出一个符合要求得等腰三角形
#include <iostream>
using namespace std;
int main()
{
int n = 0;
cin >> n;
for (int i = 0; i < n; i++)
{
for (int j = n - i - 1; j >= 0; j--)
{
cout << " ";
}
for (int j = 1; j <= 2 * i + 1; j++)
{
cout << "*";
}
cout << endl;
}
return 0;
}
for循环即可