星号打印楼梯形状-循环练习2

在这里插入图片描述
//用*号打印如下
/**
*
**




**/

#include
#include <Windows.h>

using namespace std;

int main(void) {
int line; //行

cout << "请输入打印多少行:";
cin >> line;

for(int i=0; i<line; ++i) {
	for(int j=0; j<=i; ++j) {
		cout << "*";
	}
	cout << endl;
}

system("pause");
return 0;

}
在这里插入图片描述
在这里插入图片描述在这里插入图片描述
在这里插入图片描述

发布了73 篇原创文章 · 获赞 0 · 访问量 9891

猜你喜欢

转载自blog.csdn.net/weixin_45399178/article/details/103041523
今日推荐