操作系统课设移动臂调度算法

2019-07-14 09:50发布

main #include "pcb.h" int main() { work(); getchar(); getchar(); }work.cpp
#include "pcb.h" void work() { Pcb pcb[200]; int a[200] = {}; int iChoice; int j = 0; for (int i = 0; i < 200; ++i) { pcb[i].setPcb(i, 0); } pcb[125].setuserPcb(); a[0] = 125; while (1) { iChoice = chooseInMenu(); switch (iChoice) { case 1: FIFO(pcb,a);break; case 2:break; case 3: mobileDevices(pcb,a);break; case 4: onewayScan(pcb, a);break; case 5:inputFloor(pcb,a);break; case 6:break; case 0:j = 1;break; default: break; } if (j == 1) break; } } void inputFloor(Pcb *p,int *q) { int i; int j = 0; cout << "请输入要去的楼层:"; cin >> i; while (i >= 200) { cout << "输入范围错误,请重新输入要去的楼层:"; cin >> i; } (p + i)->setuserPcb(); while (*(q + j) != '