第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

c語(yǔ)言數(shù)據(jù)結(jié)構(gòu)基礎(chǔ)問(wèn)題

c語(yǔ)言數(shù)據(jù)結(jié)構(gòu)基礎(chǔ)問(wèn)題

查看完整描述

1 回答

?
波斯汪

TA貢獻(xiàn)1811條經(jīng)驗(yàn) 獲得超4個(gè)贊

是這個(gè)意思嗎?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

#include <stdlib.h>

#include <iostream>

#define OK 1

#define MVNum 3

typedef int Status;

typedef char VerTexType;

typedef int ArcType;

struct edge//(結(jié)構(gòu))

{

    VerTexType adjvex; //最小邊的頂點(diǎn)

    ArcType lowcost; //最小邊的權(quán)值

}closedge[ MVNum ]; //輔助數(shù)組

 

Status Min() {

    int N,x,min=closedge[1].lowcost;

    for( x = 1; x < MVNum; x++) {

        if(min > closedge[x].lowcost)

            min = closedge[x].lowcost;//找closedge數(shù)組中權(quán)值最小的那組

        N = x;//N保存權(quán)值最小的那組的下標(biāo)

    }

    std::cout<<N;//輸出最小權(quán)值對(duì)應(yīng)的那組數(shù)組的下標(biāo)

    return OK;

}

 

int main(void)

{

    closedge[0].adjvex = 'A';

    closedge[0].lowcost = 3;

    closedge[1].adjvex = 'B';

    closedge[1].lowcost = 2;

    closedge[2].adjvex = 'C';

    closedge[2].lowcost = 1;

    Min();

    getchar();

    getchar();

    return 0;

 

}

 


查看完整回答
反對(duì) 回復(fù) 2019-01-03
  • 1 回答
  • 0 關(guān)注
  • 866 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)