要求所有“*”号都有用单条语句cout<<'*';所有空格都用cout<<' ';回车用cout<<endl;来打印。
*
***
*****
*******
*********
***********
*************
***************
*****************
请将完整编程打出,我等下要考试啊啊啊
追答#include
using namespace std;
int main() {
int n=9; //要输出的行数
for(int i=0;i<n;i++)
{
for(int j=1;j<n;j++)
{
for(int k=0;k<i+j;k++)
cout<<'*';
}
cout'endl';
}
return 0;
}