主题:如何用C++打印一个用“#”堆成的三角形(10行19列)?请帮我找一下我的程序错在哪里?
#include<iostream.h>
#include<iomanip.h>
int main()
{ int i,j;
cout<<setw(10)<<"#"<<endl;
for( i=9,j=1;i>0,j<10;i--,j++)
{ cout<<setw(i)
<<"#";
cout<<setfill('#')
<<setw(2*j)
<<"#"
<<endl;
}
system("pause");
}
#include<iomanip.h>
int main()
{ int i,j;
cout<<setw(10)<<"#"<<endl;
for( i=9,j=1;i>0,j<10;i--,j++)
{ cout<<setw(i)
<<"#";
cout<<setfill('#')
<<setw(2*j)
<<"#"
<<endl;
}
system("pause");
}