随笔分类 -  c/c++

单链表----递归建立,递归反转,递归打印
摘要:/** auther: Try86* time:2012/9/25 13:14* dec:单链表:递归建立,递归反转,递归打印*/#include <stdio.h>#include <stdlib.h>#include <assert.h>typedef struct list //单链表节点结构{ int data; struct list *p_next;}List;int main(void){ int num = 0; //统计单链表的节点数 List *head = NULL; ... 阅读全文
posted @ 2012-09-25 13:18 Try86 阅读(1142) 评论(0) 推荐(0)
统计文件行数_单词数_字符数
摘要:#include <stdio.h>#include <stdlib.h>/*统计文件内容行数、单词数、字符数格式:可执行文件名 -l -w -c 数据文件列表*/int main(int argc, char* argv[]){ FILE* fp; int lflag, wflag, cflag; //l w c 3个标志 int line, word; //行内与单词内标志 int lcount, wcount, ccount; //统计变量 char *s; int c; if (argc < 2) //参数个数不够 { printf ... 阅读全文
posted @ 2012-08-24 12:35 Try86 阅读(870) 评论(0) 推荐(0)