哪位老师讲解一下
这个程序用来输出一个等边三角形:
#include <iostream>
using namespace std;
void main()
{
int n;
printf("Input n : ");
cin>>n;
for (int i=0;i<n;i++)
{
for(int j=0;j<n-i-1;j++)
cout<<" ";
for(j=0;j<2*i+1;j++)
cout<<"*";
cout<<endl;
}
}
Input n : 6
*
***
*****
*******
*********
***********
请问这个是怎么执行出来的????哪个老师给讲解一下!!!!