Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created January 15, 2021 19:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/8ebd193353ee7468f77fcb98a099de79 to your computer and use it in GitHub Desktop.
Save parzibyte/8ebd193353ee7468f77fcb98a099de79 to your computer and use it in GitHub Desktop.
// Mientras que la elección del usuario no sea "2" que es para salir...
string eleccion = "";
// Hacer el ciclo
while (eleccion != "2")
{
// Imprimir los artículos
cout << "____________" << endl;
for (int i = 0; i < 4; i++)
{
// Imprimir el número para que el usuario pueda seleccionar el artículo
cout << "Número: " << i + 1 << endl;
cout << "Artículo: " << articulos[i] << endl;
cout << "Costo: " << costos[i] << endl;
cout << "Cantidad: " << cantidades[i] << endl;
cout << "____________" << endl;
}
// Imprimir el menú principal
cout << "1. Comprar artículo\n2. Salir\nSeleccione: ";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment