用C++ 语言怎么写出这样一个程序?
*
**
***
****
*****
参考答案:include<iostream.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
for(j=1;j<i;j++)
{
cout<<"*"<<endl;
}
cout<<"\n"<<endl;
}
*
**
***
****
*****
参考答案:include<iostream.h>
void main()
{
int i,j;
for(i=1;i<=5;i++)
for(j=1;j<i;j++)
{
cout<<"*"<<endl;
}
cout<<"\n"<<endl;
}