c++倒三角形

#include “stdafx.h”
#include
using namespace std;
int main()
{
int n = 5;
for (int x = 0; x < 5; x++) {
for (int i = 0; i <= x; i++)
{
cout << " ";
}
for (int y = 0; y < 2 * n - 1; y++)
{
cout << “*”;
}
cout << endl;
n -= 1;
}
return 0;
}

猜你喜欢

转载自blog.csdn.net/weixin_43210805/article/details/82794064