Los mares

Páginas: 3 (620 palabras) Publicado: 10 de febrero de 2011
CODIGO DEL PROGRAMA
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>

int arr[10][4], x=0, y=0;
int nm,i,j,cont = 0;
void main()
{
clrscr();void proc1();
proc1();
getch();
clrscr();
void proc2();
proc2();
getch();
clrscr();
void proc3();
proc3();
getch();
clrscr();
}
void proc2()//inicia ventas(ventas de boletos)
{
clrscr();
textcolor(WHITE); cprintf ( "=================ALTAS==================\n" );
textcolor(CYAN); gotoxy(14,24); cprintf ( "ALVAREZ's BUSES");textcolor(GREEN); gotoxy(8,4); cprintf ( "Que Lugar Deseas Ocupar: "); cin >> nm;

if ((nm < 1) || (nm > 40)) //para numero de aciento incorrecto//
{textcolor(LIGHTRED);gotoxy(3,8); cprintf ( "Favor De Ingresar Asiento Del 1 - 40\n\a");}
else
{
cont = nm;
for(i = 0; i < 10; i++) //inician fors buscadores
{
for (j = 0; j < 4; j++)
{cont--;
if (arr[i][j] == 0)
{
if (arr[i][j-1] == (nm-1) || arr[i][j+1] == (nm+1))
{
if ( cont == 1 )
{}else
textcolor(LIGHTRED); gotoxy(12, 8); cprintf ( "Asiento Ocupado!\a");
}
}
if (arr[i][j] == nm)
{arr[i][j] = 0;textcolor(LIGHTRED); gotoxy(12,7); cprintf ( "Son $500.. Buen Viaje");}
else
arr[i][j] = arr[i][j];
}
cont--;
}
}

textcolor(CYAN);gotoxy(3,21); cprintf ( "Presione Una Tecla Para Continuar..");
getch();
}
void proc3() //despliega la matriz, y dice que asientos estan ocupados
{
clrscr();
textcolor(WHITE);cprintf ( "================CONSULTA================\n" );
for (int i = 0; i < 10; i++)
{
for(int j = 0; j < 4; j++)
{
if ( arr[i][j] == 0 )...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • mare mare
  • El Mare Mare
  • El mar y yo
  • Mareas
  • El mar
  • El mar
  • Las Maras
  • Mar A

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS