Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Cjt_Cocheras::guardado(Cjt_Trenes &cjt, vector<int> &salen) {
- int j, k;
- j = 0;
- k = 1;
- int prior = prioritaria(cjt_cocheras, k);
- while (j < salen.size()) {
- queue<int> v = cjt.sacar_tren(salen[j]);
- while (not v.empty()) {
- if (not cjt_cocheras[prior].llena()) {
- cjt_cocheras[prior].guardar_vagon(v.front());
- v.pop();
- }
- else {
- ++k;
- prior = prioritaria(cjt_cocheras, k);
- }
- }
- ++j;
- }
- }
Add Comment
Please, Sign In to add comment