2020年5月20日

摘要: https://www.pc841.com/skill/44512.html 阅读全文

posted @ 2020-05-20 15:52 黑炽 阅读(286) 评论(0) 推荐(0) 编辑

2020年5月17日

摘要: 同学帮忙给我写的一份 #pragma once //(批注)用这个保证不会重包含 //(批注)在这里写包含你需要用到的库,用到的越少越好,用到多个库时按字典顺序排列 #include <iostream> //(批注)在自己写的库中,尽量(尽最大可能)不用using nsmespace,一定不要用 阅读全文

posted @ 2020-05-17 11:35 黑炽 阅读(698) 评论(0) 推荐(0) 编辑

摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include "listGraph.cpp" 4 5 int main(void) { 6 listGraph G;//定义保存邻接矩阵结构的图 7 int i, j; 8 9 printf("请输入生成图的类 阅读全文

posted @ 2020-05-17 09:27 黑炽 阅读(1237) 评论(0) 推荐(0) 编辑

摘要: 1 #include<stdio.h> 2 #include<stdlib.h> 3 #include<string.h> 4 5 typedef struct bigInt { 6 char* num;//指向长整数数组,序号0中保存着最低位,也就是倒序存放 7 char minus;//符号,1 阅读全文

posted @ 2020-05-17 08:04 黑炽 阅读(239) 评论(0) 推荐(0) 编辑

摘要: 1 //挺有意思的小游戏,可以在N,M这里改动数据。 2 #include<stdio.h> 3 #include<stdlib.h> 4 #define N 41//总人数 5 #define M 3//数到3 出列 6 int main(void) { 7 int people[N] = { 0 阅读全文

posted @ 2020-05-17 08:01 黑炽 阅读(159) 评论(0) 推荐(0) 编辑

摘要: 1 #include<stdio.h> 2 #include "matrixGraph.cpp" 3 4 int main(void) { 5 MatrixGraph G;//定义保存邻接矩阵结构的图 6 int i, j; 7 8 printf("请输入生成图的类型(0.无向图, 1.有向图):" 阅读全文

posted @ 2020-05-17 07:59 黑炽 阅读(342) 评论(0) 推荐(0) 编辑

2020年5月14日

摘要: 阅读全文

posted @ 2020-05-14 17:25 黑炽 阅读(87) 评论(0) 推荐(0) 编辑

2020年5月11日

摘要: 1 //去基准数 为首元素,为元素和 处于中间元素值的中位数 2 ElementType median(ElementType a[], int left, int right) { 3 int center = (left + right) / 2; 4 5 if (a[left] > a[cen 阅读全文

posted @ 2020-05-11 11:36 黑炽 阅读(150) 评论(0) 推荐(0) 编辑

摘要: 1 //递归实现归并排序 2 //l左边的起始位置,r右边起始位置,rightEnd右边终点位置 3 //merge函数用来合并两段有序序列 4 void merge(ElementType a[], ElementType t[], int l, int r, int rightEnd) { 5 阅读全文

posted @ 2020-05-11 10:44 黑炽 阅读(247) 评论(0) 推荐(0) 编辑

2020年5月9日

摘要: 1 void shellSort(ElementType a[], int n) {//原始希尔排序 2 int d, i, j; 3 int temp; 4 5 for (d = n / 2; d > 0; d /= 2) {//希尔增量序列 6 for (i = d; i < n; i++) { 阅读全文

posted @ 2020-05-09 10:57 黑炽 阅读(163) 评论(0) 推荐(0) 编辑