⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fcfs.cpp

📁 This program sorts words in a line of text by length.
💻 CPP
字号:
#include <iostream.h>
#include <conio.h>
void main()
{
	clrscr();
	int bt[10];
	int i=0,j,k;
   float avg;
	int sum=0;
	char choice;
	cout<<"\n\n\t\tFirst Come First Served Scheduling Algorithm";
	do
	{
		cout<<"\nEnter burst time for Process "<<i+1<<" : ";
		cin>>bt[i];
		cout<<"Want to continue (Y/N)? : ";
		cin>>choice;
		i++;
	}while(choice=='y'||choice=='Y');
	for(j=0;j<i;j++)
	{
		for(k=0;k<j;k++)
			sum=sum+bt[k];
	}
	avg=sum/i;
	cout<<"\n\n\tAverage waiting time is :: "<<avg;
	getch();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -