/*PROGRAM RUMAH*/
#pragma argsused
#include<conio.h>
#include<iostream.h>
#include<math.h>
int main()
{
int n, seg, i, j, k, ting;
cout<<"PROGRAM MEMBUAT RUMAH"<<endl;
cout<<"---------------------"<<endl;
cout<<"Masukkan tinggi rumah : "; cin>>n;
seg=n/2;
ting=n-seg;
cout<<endl;
for(i=1;i<=seg;i++)
{
for(j=i;j<=seg-1;j++) cout<<" ";
for(k=1;k<=i;k++) cout<<"* ";
cout<<endl;
}
for (i=1; i<=ting; i++)
{
for (j=1; j<=seg; j++)
cout<<"* ";
cout<<endl;
}
getch();
}
0 komentar:
Posting Komentar