Bachiller

Páginas: 2 (275 palabras) Publicado: 23 de enero de 2013
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
void main()
{
int i1,j1,n,x1=0,y1=0,i2,j2,x2=10,y2=10;
char car='*',opc,opc1;do{
clrscr();
cout<<"Ingrese tamaño de las figuras:\n";
cin>>n;
if(n<1)
cout<<"Error, ingrese numero mayor a 0.";}while(n<1);do{
clrscr();
for(i1=0;i1<y1;i1++)
cout<<endl;

for(i1=0;i1<n;i1++)
{

for(j1=0;j1<x1;j1++)
cout<<" ";//Primera figura...

for(j1=0;j1<n;j1++)
{
if(i1==0 || j1==0 || j1==n-1 || i1==n/2)
cout<<car;
elsecout<<" ";
}
cout<<endl;
}
opc=getch();
if(opc=='d' || opc=='D')
x1++;
else if(opc=='a' ||opc=='A')
x1--;
else if(opc=='w' ||opc=='W')
y1--;
else if(opc=='s' || opc=='S')
y1++;
getch(); }while(opc!='x' ||opc!='X');

do{
clrscr();

for(i2=0;i2<y2;i2++)//segunda figura…
cout<<endl;

for(i2=0;i2<n;i2++)
{
for(j2=0;j2<x2;j2++)
cout<<" ";for(j2=0;j2<n;j2++)
{
if(j2==0 || i2==0 || i2==n-1 || i2<=n/2 || j2>=n/2 && i2==4)
cout<<car;
else
cout<<" ";
}cout<<endl;
}

opc1=getch();
if(opc=='l' || opc1=='L')
x1++;
else if(opc1=='j' ||opc1=='J')
x1--;
else if(opc1=='i' || opc1=='I')y1--;
else if(opc1=='k' || opc1=='K')
y1++;
getch(); }while(opc1!='x' ||opc1!='X');
//segunda figura....
getch();

}
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Bachiller
  • Bachiller
  • Bachiller
  • Bachiller
  • Bachiller
  • Bachiller
  • Bachiller
  • Bachiller

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS