Skip to content

Instantly share code, notes, and snippets.

View AlexandreHiroyuki's full-sized avatar
✨
Connecting the dots…

Alexandre Hiroyuki AlexandreHiroyuki

✨
Connecting the dots…
View GitHub Profile
@AlexandreHiroyuki
AlexandreHiroyuki / elderly_queue_problem.c
Last active January 3, 2023 23:54 — forked from Amorim33/elderly_queue_problem.c
Algorithm to solve elderly queue problem
// A commercial establishment implemented a service system with a single queue,
// in which people always enter at the end of the queue, except if they are elderly (those over
// 59 years old), who always enter before the person younger than him who is closest to the
// start of the queue.
// Implement a program to control this queue, in order to meet the requirements
// above.
// The program must read a sequence of people, each one with their age and the time they entered.
// Considering that each person is attended in 3 minutes, the program must print the queue at each time a person enters it.
#include<stdio.h>