#include
#include
#pragma argsused
int main()
{
int n,baris,i,j,k,z;
cout<<"+++++Membuat Bentuk Segitiga+++++"<
cin>>n;
cout<
{
baris=0;
z=n;
for (i=1;i<=n;i++)
{
for (j=1;j<=baris;j++) cout<<" ";
for (k=1;k<=z;k++) cout<<"* ";
cout<
baris=baris+1;
}
}
else
{
for(i=1;i<=n;i++) cout<<"* ";
cout<
z=n-3;
for (i=1;i<=n-3;i++)
{
for (j=1;j<=baris;j++) cout<<" ";
cout<<"* ";
for (k=1;k<=z;k++) cout<<" ";
cout<<"*";
cout<
baris=baris+1;
}
z=2;
for (i=1;i<=2;i++)
{
for (j=1;j<=baris;j++) cout<<" ";
for (k=1;k<=z;k++) cout<<"* ";
cout<
baris=baris+1;
}
}
getch();
}
Tidak ada komentar:
Posting Komentar