Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 11, 2022 00:04
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/1a4f0f788cc95c7b41473a7f4b65706c to your computer and use it in GitHub Desktop.
Save parzibyte/1a4f0f788cc95c7b41473a7f4b65706c to your computer and use it in GitHub Desktop.
void mostrarEstadoEstacionamiento(struct LugarEstacionamiento lugares[CANTIDAD_CARROS + CANTIDAD_MOTOS])
{
int i;
for (i = 0; i < CANTIDAD_CARROS; i++)
{
printf("#%d [CARRO] ", i + 1);
if (lugares[i].estado == OCUPADO)
{
printf("Ocupado por %s desde ", lugares[i].placa);
imprimirFechaAPartirDeTimestamp(lugares[i].entrada);
}
else
{
printf("Desocupado");
}
printf("\n");
}
for (; i < CANTIDAD_CARROS + CANTIDAD_MOTOS; i++)
{
printf("#%d [MOTO] ", i + 1);
if (lugares[i].estado == OCUPADO)
{
printf("Ocupado por %s desde ", lugares[i].placa);
imprimirFechaAPartirDeTimestamp(lugares[i].entrada);
}
else
{
printf("Desocupado");
}
printf("\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment