哪位哥们帮编个程序

来源:百度知道 编辑:UC知道 时间:2024/05/16 15:42:06
哪位朋友帮我编个程序,要求输出
#
##
###
####
#####
必须得用C++编,还得是for语句,这是我们作业,我考虑了半天不知道怎么编,谢谢了

#include <iostream>
using namespace std;
int main()
{
for(int i = 0; i <= 4; i++)
{
for(int j=0; j <= i; j++)
cout<< "#";
cout<< endl;
}
}
刚开始学,尽量自己编,多练就会了