input berbintang
#include <iostream.h>
#include <conio.h>
int main()
{
int a,b,inp;
cout<<"N:";cin>>inp;
cout<<endl;
for(a=1;a<=inp;a++)
{cout<<endl;
for(b=1;b<=a;b++)
{
cout<<"*"<<"";
}
}
for(a=1;a>=0;a--)
{cout<<endl;
for(b=0;b<=a;b++)
{
cout<<"*"<<"";
}
}
cout<<"\nN:";cin>>inp;
cout<<endl;
for(a=1;a<=inp;a++)
{cout<<endl;
for(b=1;b<=a;b++)
{
cout<<"*"<<"";
}
}
for(a=2;a>=0;a--)
{cout<<endl;
for(b=0;b<=a;b++)
{
cout<<"*"<<"";
}
}
getch();
}
Komentar
Posting Komentar