-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
39 lines (34 loc) · 851 Bytes
/
main.c
File metadata and controls
39 lines (34 loc) · 851 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <stdio.h>
#include <conio.h>
#include <locale.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <stdbool.h>
#include "procesos_functions.h"
int main() {
int newOrQuit;
bool endPlanner = false, initialized = false;
setlocale(LC_CTYPE, "Spanish");
while (!endPlanner) {
if (!initialized) {
initProcessScheduler();
} else {
printf("\nMenú:\n1- Agregar nuevos procesos.\n2- Salir\n");
while (scanf("%d", &newOrQuit) != 1 || newOrQuit < 0 || newOrQuit > 2) {
printf("El valor ingresado no es válido, ingresa otro...\n");
clearInputBuffer();
};
clearInputBuffer();
if (newOrQuit == 1) {
initProcessScheduler();
} else {
endPlanner = true;
}
}
initialized = true;
}
printf("Gracias por usar el planificador de procesos. #ThisIsCS50 :)");
getch();
return 0;
}