上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 23 下一页
摘要: 1.代码: #include <reg52.h> //<reg51.h> 包含52单片机寄存器库sbit led = P1^0; //只有地址可以被8整除的 才可以用sbit单端定义某一位 // p0-p3口都可以被sbit单单独定义void main (void){ led = 1; //初始化P 阅读全文
posted @ 2016-12-15 13:49 王小波私人定制 阅读(208) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>/* Floyd算法 */#define VNUM 5#define MV 65536int P[VNUM][VNUM];int A[VNUM][VNUM];int Matrix[VNUM][VNUM] ={ {0, 10, 阅读全文
posted @ 2016-12-14 12:16 王小波私人定制 阅读(240) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>/* Dijkstra算法 */#define VNUM 5#define MV 65536int P[VNUM]; //保存最短路径int Dist[VNUM];int Mark[VNUM];int Matrix[VNUM] 阅读全文
posted @ 2016-12-14 10:03 王小波私人定制 阅读(673) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h>#include <stdlib.h>/* 最小路径算法 --》prim算法 */#define VNUM 9#define MV 65536int P[VNUM];int Cost[VNUM];int Mark[VNUM]; //标记数组int Matrix[V 阅读全文
posted @ 2016-12-14 09:35 王小波私人定制 阅读(387) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#include <stdlib.h>#include "LGraph.h"/* run this program using the console pauser or add your own getch, system("pause") or input 阅读全文
posted @ 2016-12-12 11:52 王小波私人定制 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#include <stdlib.h>#include "MGraph.h"/* run this program using the console pauser or add your own getch, system("pause") or input 阅读全文
posted @ 2016-12-12 11:37 王小波私人定制 阅读(543) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#include <stdlib.h>#include "Graph.h"/* 图的定义 */int main(int argc, char *argv[]){ Graph* graph = Graph_Create(5); Graph_AddEdge(gra 阅读全文
posted @ 2016-12-12 11:00 王小波私人定制 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>int func(int x){ if( x > 1 ) { return x * func(x - 1); } else { return 1; }}int main(){ printf("x! = %d\n", func(4)); return 0;}说明 阅读全文
posted @ 2016-12-12 09:52 王小波私人定制 阅读(388) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>#include <malloc.h>#define MALLOC(type, n) (type*)malloc(n * sizeof(type))int main(){ int* p = MALLOC(int, 5); int i = 0; for(i=0; 阅读全文
posted @ 2016-12-12 09:46 王小波私人定制 阅读(319) 评论(0) 推荐(0) 编辑
摘要: 1.#include <stdio.h>int main(){ int k = 2; int a = 1; k = k++ + k++; printf("k = %d\n", k); if( a-- && a ) { printf("a = %d\n", a); } return 0;} 2.#in 阅读全文
posted @ 2016-12-12 09:40 王小波私人定制 阅读(182) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 23 下一页
DON'T FORGET TO HAVE FUN