![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
文章平均质量分 73
LiveStar
Normal Man
展开
-
qsort函数应用大全
一、对int类型数组排序 int num[100]; Sample: int cmp ( const void *a , const void *b ) { return *(int *)a - *(int *)b; } qsort(num,100,sizeof(num[0]),cmp); 二、对char类型数组排序(同int类型) char word[100]; Sample: int cmp转载 2008-07-22 19:59:00 · 540 阅读 · 0 评论 -
Prim算法
#include //max表示点,边的最大个数#define max 1000//wq表示两点的距离为无穷#define wq 9999//邻接矩阵存储相应的边的权重int mix[max][max];//输入并构造邻接矩阵void input(int n,int m){ int i,j,sp,ep,wg; //初始化邻接矩阵每个都是无穷大 for (i=0;i for (j=0;j原创 2008-07-23 19:39:00 · 558 阅读 · 0 评论