- 博客(6)
- 收藏
- 关注
原创 约瑟夫环
1 到 n 个人,从第 1 个开始数,数到 k 的退出,然后旁边的重新开始数,数到 k 退出,如此循环,直到所有人都退出。#include #include typedef int datatype;typedef struct node{ datatype data; struct node *next;}*linklist,listnode;linklist creat
2011-10-30 20:47:17 168
原创 一元多项式的运算(加、减、乘)C 实现
/*==========================================A: 1*(x^2) + 2*(x^3) +....+ 4*(x^15) + ...B: 5*(x^2) + 4*(x^4) +....+ 8*(x^15) + ...计算 A + B ,A - B ,A * B = ?测试数据: 5-2 1 4 -5-5 1 6 8 9 83
2011-10-30 09:18:00 976 1
原创 双向循环链表
#include #include typedef struct node{ int data; struct node *prior,*next;}*dlinklist,dlistnode;#define N sizeof(dlistnode)dlinklist create_dlist(int a)//创建只有一个元素的双向链表{ dlistnode *head = (
2011-10-27 17:18:33 252
原创 单链表的各种操作(建立,查找,删除,插入,归并等)
#include #include #define OK 1#define ERROR 0typedef int datatype ;typedef struct node{ datatype data; struct node *next;}listnode , *linklist;int length;//表长linklist create_list(int len)
2011-10-26 15:47:11 622
原创 顺序表的各种操作(建立,查找,删除,插入等)
原来的发现有点小问题,重新修改了下,在DEV中运行成功。#include #include #define OK 1#define ERROR 0typedef int ElemType;#define LIST_INIT_SIZE 100#define INCREMENT 10typedef struct{ ElemType *elem;
2011-10-26 15:41:27 1152
原创 C语言中的floor函数与cei函数
floor 函数与 ceil 函数都包含在头文件 中函数原型double floor ( double x ); floor 函数取的是等于或小于x的 最大 整数;double ceil ( double x );
2011-09-25 16:01:53 1581
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人