visual studio圣诞树代码
时间: 2023-04-29 08:00:11 浏览: 343
html实现圣诞树代码
以下是Visual Studio圣诞树代码:
#include <iostream>
using namespace std;
int main()
{
int height;
cout << "请输入圣诞树的高度:";
cin >> height;
for (int i = 1; i <= height; i++)
{
for (int j = 1; j <= height - i; j++)
{
cout << " ";
}
for (int k = 1; k <= 2 * i - 1; k++)
{
cout << "*";
}
cout << endl;
}
for (int i = 1; i <= height - 1; i++)
{
for (
阅读全文