Vale voy a intentarlo jeje muchisimas gracias por la ayuda!! a ver que sale luego te escribo jeje
#include <stdio.h>
#include <queue>
#include <stdexcept>
#include <stdlib.h> // srand, rand
#include <iostream>
#include <string>
#include <time.h>
using namespace std;
const unsigned short int G = 0;
const unsigned short int D = 1;
const unsigned short int M = 2;
const unsigned short int I = 3;
struct Vehicle{
int matricula; // según tu país puede ser numerico o no
string marca;
string modelo;
short unsigned int potencia;
//enum tipo {G, D, M, I};
unsigned short int tipo;
tm hora_llegada;
tm hora_salida;
tm fecha;
enum estado_ITV {BUENO, MALO, REGULAR};
};
void atender(Vehicle v);
Vehicle GeneraVehiculo();
void sleep(unsigned int mseconds);
int main(){
Vehicle v,vc;
queue<Vehicle> colas[4];
while(true)
{
v = GeneraVehiculo();
printf("Ingresa vehiculo (tipo %d) de matricula %d\n",v.tipo,v.matricula);
if (colas[v.tipo].empty())
atender(v);
else
{
// atiendo a quien espera en cola
vc = colas[(int)v.tipo].front();
colas[(int)v.tipo].pop();
atender(vc);
colas[(int)v.tipo].push(v); // encolo al recien llegado
}
}
return 0;
}
void sleep(unsigned int mseconds)
{
clock_t goal = mseconds + clock();
while (goal > clock());
}