예제 #1
0
void main()
{
	clrscr();
	cout << "Enter the Number of Process : ";
	cin >> n;

	cout << "\n\n1) FCFS   2) SJF   3) SRTF   4) RR\n\n";
	cout << "Enter Your Choice : ";
	cin >> choice;

	cout << "\n";
	int i;
	for(i=0;i<n;i++)
	{
	cout << "Arrival Time & Service Time for Process " << i+1 << " : ";
	tab[i][0]=i+1;
	cin >> tab[i][1];
	cin >> tab[i][2];
	}
	ttt=totaltime();
	switch(choice)
	{
		case '1': fcfs();break;
		case '2': sjf();break;
		case '3': srtf();break;
		case '4': rr();break;
		default : exit(0);
	}

}
예제 #2
0
int main (void )
{
  int valor;

  printf ("Digite um escalonamento: \n\n");
  printf ("1) FCFS \n");
  printf ("2) SJF \n");
  printf ("3) SRTF \n");
  printf ("4) ROUND ROBIN \n");
  printf ("5) MULTINIVEL \n");
  printf ("6) SAIR \n\n");
  scanf("%d", &valor);

  switch ( valor )
  {
     case 1 :
       fcfs();
     break;

     case 2 :
       sjf();;
     break;

     case 3 :
        srtf();;
     break;

     case 4 :
        roundrobin();
     break;

     case 5 :
        multinivel();
     break;

     case 6 :
        printf ("\nFim.\n");
     break;

     default :
       printf ("Valor invalido!\n");
  }

  return 0;
}