-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
23 lines (22 loc) · 695 Bytes
/
main.cpp
File metadata and controls
23 lines (22 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <bits/stdc++.h>
#include "processinho.hpp"
#include "fifo.hpp"
#include "sjf.hpp"
using namespace std;
int main(int argc, char const *argv[]) {
int numeroDeProcessos;
cout << "Digite o numero de processos:\n";
cin >> numeroDeProcessos;
processo vet[numeroDeProcessos];
for (int i=0; i<numeroDeProcessos; i++){
cout << "Digite o tempo de chegada do processo: " << (char)(i+'A') << endl;
cin >> vet[i].chegada;
cout << "Digite a duracao do processo: " << (char)(i+'A') << endl;
cin >> vet[i].duracao;
vet[i].nome='A'+i;
}
sort(vet, vet+numeroDeProcessos, cmp);
fifo(vet, numeroDeProcessos);
sjf(vet, numeroDeProcessos);
return 0;
}