Crayon Syntax Highlighter 是一款优秀的代码高亮插件,后台有详细的设置选项
而且它的前台界面也有一些按钮 比如可以用户自定义是否显示行号 还有复制按钮
下面是一段演示代码
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
#include <stdio.h> #include <malloc.h> typedef struct Node { int data; struct Node * pnext; }NODE, *PNODE; struct Node * create_list(struct Node * phead); void traverse_list(struct Node * phead); int main(void) { struct Node * phead = NULL; phead = create_list(phead); traverse_list(phead); return 0; } struct Node * create_list(struct Node * phead) { int n, i; struct Node * ptail; phead = (struct Node *)malloc(sizeof(struct Node)); ptail = phead; printf("要输入几个节点:n = "); scanf("%d", &n); for (i = 0; i < n; i++) { ptail->pnext = (struct Node *)malloc(sizeof(struct Node)); ptail = ptail->pnext; printf("请输入第%d个节点的值:", i+1); scanf("%d", &ptail->data); ptail->pnext = NULL; } return phead; } void traverse_list(struct Node * phead) { struct Node * p = phead->pnext; while(p != NULL) { printf("%d ", p->data); p = p->pnext; } } |
经雅乐网测试 代码复制之后直接粘贴就可以运行咯