📄 ds7.2.1.htm
字号:
(i=0;i<G->n;i++) <span style="mso-spacerun: yes"> </span></font></b></font></span></p>
<p class="MsoPlainText" style="margin-top: 0; margin-bottom: 0"><span lang="EN-US"><font size="5" color="#FFFFFF"><b><span style="mso-spacerun: yes; font-family: Times New Roman">
</span></b></font></span><span lang="EN-US" style="font-family:"Times New Roman""><font color="#FFFFFF"><b><font size="5">scanf("\n%c",&(G->vexs[i]));<span style="mso-spacerun: yes">
</span></font></b></font></span><font color="#FFFFFF"><b><font size="5"><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman">/*</span><span style="mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Times New Roman; mso-hansi-font-family: Times New Roman">输入顶点信息,建立顶点表</span><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman">*/</span><span lang="EN-US" style="font-family:"Times New Roman""><o:p>
</o:p>
</span></font></b></font></p>
<p class="MsoPlainText" style="margin-top: 0; margin-bottom: 0"><span lang="EN-US"><font size="5" color="#FFFFFF"><b><span style="font-family: Times New Roman"> </span></b></font></span><span lang="EN-US" style="font-family:"Times New Roman""><font color="#FFFFFF"><b><font size="5">for
(i=0;i<G->n;i++)<o:p>
</o:p>
</font></b></font></span></p>
<p class="MsoPlainText" style="margin-top: 0; margin-bottom: 0"><span lang="EN-US"><font size="5" color="#FFFFFF"><b><span style="font-family: Times New Roman">
</span></b></font></span><span lang="EN-US" style="font-family:"Times New Roman""><font color="#FFFFFF"><b><font size="5">for
(j=0;j<G->n;j++)<span style="mso-spacerun: yes"> </span></font></b></font></span></p>
<p class="MsoPlainText" style="margin-top: 0; margin-bottom: 0"><span lang="EN-US"><font size="5" color="#FFFFFF"><b><span style="mso-spacerun: yes; font-family: Times New Roman">
</span></b></font></span><span lang="EN-US" style="font-family:"Times New Roman""><font color="#FFFFFF"><b><font size="5">G->edges[i][j]=0;<span style="mso-spacerun: yes">
</span><span style="mso-spacerun:
yes"> </span></font></b></font></span><font color="#FFFFFF"><b><font size="5"><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman">/*</span><span style="mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Times New Roman; mso-hansi-font-family: Times New Roman">初始化邻接矩阵</span><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman">*/</span><span lang="EN-US" style="font-family:"Times New Roman""><o:p>
</o:p>
</span></font></b></font></p>
<p class="MsoPlainText" style="margin-top: 0; margin-bottom: 0"><span lang="EN-US"><font size="5" color="#FFFFFF"><b><span style="font-family: Times New Roman"> </span></b></font></span><span lang="EN-US" style="font-family:"Times New Roman""><font color="#FFFFFF"><b><font size="5">printf("</font></b></font></span><font color="#FFFFFF"><b><span style="mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman""><font size="4">请输入每条边对应的两个顶点的序号</font></span><font size="5"><span lang="EN-US" style="font-family:"Times New Roman"">(</span><span style="mso-ascii-font-family:"Times New Roman";mso-hansi-font-family:"Times New Roman"">输入格式为</span><span lang="EN-US" style="font-family:"Times New Roman"">:i,j):\n");<o:p>
</o:p>
</span></font></b></font></p>
<p class="MsoPlainText" style="margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-family:"Times New Roman""><span style="mso-spacerun: yes"><font color="#FFFFFF"><b><font size="5"> </font></b></font></span><font color="#FFFFFF"><b><font size="5">for
(k=0;k<G->e;k++)<o:p>
</o:p>
</font></b></font></span></p>
<p class="MsoPlainText" style="margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-family:"Times New Roman""><span style="mso-tab-count:1"><font color="#FFFFFF"><b><font size="5">
</font></b></font></span><font color="#FFFFFF"><b><font size="5">{scanf("\n%d,%d",&i,&j);
<span style="mso-spacerun:
yes"> </span></font></b></font></span><font color="#FFFFFF"><b><font size="5"><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman">/*</span><span style="mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Times New Roman; mso-hansi-font-family: Times New Roman">输入</span><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman">e</span><span style="mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Times New Roman; mso-hansi-font-family: Times New Roman">条边,建立邻接矩阵</span><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman">*/</span><span lang="EN-US" style="font-family:"Times New Roman""><o:p>
</o:p>
</span></font></b></font></p>
<p class="MsoPlainText" style="margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-family:"Times New Roman""><span style="mso-tab-count:1"><font color="#FFFFFF"><b><font size="5">
</font></b></font></span><font color="#FFFFFF"><b><font size="5">G->edges[i][j]=1;<span style="mso-spacerun: yes">
</span></font></b></font></span><font color="#FFFFFF"><b><font size="5"><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman">/*</span><span style="mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Times New Roman; mso-hansi-font-family: Times New Roman">若加入</span><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman">G->edges[j][i]=1;</span><span style="mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Times New Roman; mso-hansi-font-family: Times New Roman">,</span><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman">*/<o:p>
</o:p>
</span></font></b></font></p>
<p class="MsoPlainText" style="margin-top: 0; margin-bottom: 0"><font size="5" color="#FFFFFF"><b><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman"><span style="mso-spacerun:
yes">
</span>/*</span><span style="mso-bidi-font-size: 10.0pt; mso-ascii-font-family: Times New Roman; mso-hansi-font-family: Times New Roman">则为无向图的邻接矩阵存储建立</span><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman">*/</span><span lang="EN-US" style="font-family:"Times New Roman""><o:p>
</o:p>
</span></b></font></p>
<p class="MsoPlainText" style="margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-family:"Times New Roman""><span style="mso-spacerun: yes"><font color="#FFFFFF"><b><font size="5">
</font></b></font></span><font color="#FFFFFF"><b><font size="5">}<o:p>
</o:p>
</font></b></font></span></p>
<p class="MsoPlainText" style="margin-top: 0; margin-bottom: 0"><span lang="EN-US" style="font-family:"Times New Roman""><font color="#FFFFFF"><b><font size="5">}</font></b></font></span><font color="#FFFFFF"><b><font size="5"><span lang="EN-US" style="mso-bidi-font-size: 10.0pt; font-family: Times New Roman">/*CreateMGraph*/</span></font></b></font></p>
<p align="center"><b><span style="mso-bidi-font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: Times New Roman; mso-hansi-font-family: Times New Roman; mso-bidi-font-family: Times New Roman; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA"><font color="#FFFFFF" size="5"> </font><a href="ds7.2.htm"><font color="#FFFF00" size="5">返回</font></a></span></b></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -