c++打印以下:
....*
...**
..***
.****
*****
代码:
#include<iostream>
using namespace std;
#define n 5
void out(){
for(int i=0;i<n;i++)
{
for(int j=i;j<n-1;j++)
cout<<". ";
for(int k=0;k<i+1;k++)
cout<<"* ";
cout<<endl;
}
}
void main()
{
out();
while(1);
}