posted @ 2020-05-20 15:52 黑炽 阅读(314) 评论(0) 推荐(0)
摘要:
https://www.pc841.com/skill/44512.html 阅读全文
摘要:
同学帮忙给我写的一份 #pragma once //(批注)用这个保证不会重包含 //(批注)在这里写包含你需要用到的库,用到的越少越好,用到多个库时按字典顺序排列 #include <iostream> //(批注)在自己写的库中,尽量(尽最大可能)不用using nsmespace,一定不要用 阅读全文
posted @ 2020-05-17 11:35 黑炽 阅读(714) 评论(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 黑炽 阅读(1267) 评论(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 黑炽 阅读(254) 评论(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 黑炽 阅读(161) 评论(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 黑炽 阅读(351) 评论(0) 推荐(0)
摘要:
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 黑炽 阅读(156) 评论(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 黑炽 阅读(260) 评论(0) 推荐(0)