current_minute=(jobs[i]
total_time+=jobs[i]
}
cout< } //運算時間短的作業優先算法 void shorter() { int i,j,p; int current_hour; int current_minute; int current_need_time; int total_time=0; //輸出作業流 cout< cout< cout<<"------------------------------------------------------------------------"< cout.setf(2); cout< current_hour=jobs[quantity-1].reach_hour; current_minute=jobs[quantity-1].reach_minite; for(i=0;i current_need_time=30000; for(j=0;j if((jobs[j].visited==0)&&(jobs[j].need_time p=j; current_need_time=jobs[j].need_time; } } jobs[p].start_time=current_hour*100+current_minute; [1] [2] [3] [4] [5] [6] [7] [8] [9]
From:http://tw.wingwit.com/Article/program/czxt/201311/24013.html