您好,欢迎来到微智科技网。
搜索
您的当前位置:首页流水作业调度完整代码

流水作业调度完整代码

来源:微智科技网


// 流水作业调度.cpp : 定义控制台应用程序的入口点。 #include"stdafx.h"

#include <iostream>

#include<iomanip>

using namespace std;

static int NUM;

struct JOB

{

int a;// 1st

int b;// 2nd

bool type;//mark a>b or b>a

int index;//save initial subscript

};

void Sort( JOB* );

void Input( JOB* );

void Output(JOB*);

void Order(JOB*);

int _tmain(int argc, _TCHAR* argv[])

{

cout << "请输入要加工的工件数量:";

cin >> NUM;

JOB* work=new JOB[NUM];

cout << "请输入数据:\\n";

Input(work);

Sort(work);

Order(work);

Output(work);

delete work;

return 0;

}

void Sort( JOB* temp )

{

int b =0, c = 0;

for (int a = 0; a < NUM; a++)

{

if (temp[a].type == 0)//count

b++;// num of type 0

else

c++;// num of type 1

}

JOB* wo = new JOB[b];

因篇幅问题不能全部显示,请点此查看更多更全内容

Copyright © 2019- 7swz.com 版权所有 赣ICP备2024042798号-8

违法及侵权请联系:TEL:199 18 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务