#include<iostream>
using namespace std;
void output(int n)
{
for (int i = 0; i < n; i++)
{
int temp = i;
for (int j = 0; j <= n - (n + 1); j++)
cout << " ";
while ((temp + 1)>0)
{
cout << "* ";
temp--;
}
cout << endl;
}
}
void main()
{
int a;
cout << "输出等边三角形的值: ";
cin >> a;
output(a);
}
图形输出
最新推荐文章于 2024-01-16 22:23:13 发布