. . . . } private void SJF(){ System.out.println(\:短作业优先算法===\ System.out.println(\到达时间是:\ for(i=0;i
. . . . } } } for(i=1;i start_time[m[i]]=arrival_time[m[i]]; . . . . } for(i=0;i . . . . wo.process_number=Integer.parseInt(str1); wo.arrival_time=new int[wo.process_number]; wo.services_time=new int[wo.process_number]; wo.start_time=new int[wo.process_number+1]; wo.completion_time=new int[wo.process_number+1]; wo.turn_around_time=new int[wo.process_number+1]; wo.right_turn_around_time=new double[wo.process_number+1]; wo.m=new int[wo.process_number+1]; wo.n=new int[wo.process_number]; String str=null; String str2=null; System.out.println(\请输入各进程到达时间\ for(i=0;i . . . . System.out.println(\先来先服务【0】========\ System.out.println(\短作业优先【1】========\ System.out.println(\退出系统【2】========\ String str3=null; str3=buf.readLine(); i=Integer.parseInt(str3); while(i!=2){ switch(i){ case 0: wo.FCFS(); break; case 1: wo.SJF(); break; default: } System.out.println(\先来先服务【0】========\ System.out.println(\短作业优先【1】========\ System.out.println(\退出系统【2】========\ str3=buf.readLine(); i=Integer.parseInt(str3); } System.out.println(\系统已退出!\} } System.out.println(\输入有误,请重新输入\四、实验结果及分析 运行结果 . . . . .