- 博客(11)
- 收藏
- 关注
转载 模块的内置方法--Python提高班
模块的内置方法--Python提高班这期的话题有点简单, 整理下常见的模块内置方法刚开始学Python的时候, 看到if __name__ == '__main__': main()就不明觉厉了, 一直好奇__name__这货到底是个什么东东实际上, __name__是Python中模块的内置属性, 除此之外, 经常用到的还有__file__, __doc__, __all
2014-05-06 15:48:57
842
原创 python3.4 百度贴吧小爬虫
zhuaimport string,urllib.requestdef cookie(get_page,begin,end): for i in range(begin,end+1): sname = 'f:/test/' + '网页' + str(i).zfill(3) + '.html' print ('正在下载第' + str(i) + '个页面
2014-04-25 21:14:16
1612
转载 python 2/3 的主要区别
Python2.4+ 与 Python3.0+ 主要变化或新增内容Python2 Python3print是内置命令 print变为函数print >> f,x,y print(x,y,file=f)print x, print(x,end='')reload(M)
2014-04-25 17:54:50
702
原创 判断中心对称
//同一字符串,存入链表和栈,通过比较出栈元素和链表来判断是否中心对称#include#include#include//定义单链表结构类型typedef char datatype;//datatype == chartypedef struct node //结点结构体,内有char类型data,结点指针*next{ datatype data; struct no
2014-03-31 17:57:30
1385
原创 队列操作--出队入队
/// : 假设以数组sequ[m]存放循环队列的元素,同时设变量/// rear 和quelen 分别指示循环队列中队尾元素的位置和内含元素的个数。/// 试给出判别此循环队列的队满条件,并写出相应的入队列和出队列的算法。/// 说明:本程序之所以不用typedef 把char定义成datatype,是因为:/// 在C语言中没有输入输出的重构函数,所以即使把char定义成datatyp
2014-03-31 17:55:04
1762
转载 离散事件仿真程序的实现
//离散事件模拟,模拟银行营业时的排队情况//不考虑顾客中途离开,顾客到达事件随机,业务办理时间//长度随机,选择最短的队排队,不再换队//作者:nuaazdh//时间:2011年12月10日 08:52:37#include #include #include #define OK 1#define ERROR 0#define TRUE 1#define FALSE 0
2014-03-31 17:50:41
1933
原创 链表的重新组合问题
链表中将输入按字母、数字、其他分类输出#include #include #include typedef char datatype;typedef struct node{ datatype data; struct node *next;}linklist;linklist *CreatListF(){ char ch; linklist *head,*s,
2014-03-25 08:46:36
595
原创 链表排序问题
#include #include #include typedef char datatype;typedef struct node{ datatype data; struct node *next;}linklist;linklist *CreatListF(){ char ch; linklist *head,*s,*r; head =(linklist*
2014-03-24 17:58:45
674
原创 两个链表的合并问题
#include#include#include#define MAXSIZE 1024typedef int datatype;typedef struct{ datatype data[MAXSIZE]; int last;}sequenlist;sequenlist *Create()
2014-03-24 17:22:11
581
原创 单链表的逆置问题
#include#include#include//#define NULL 0typedef char datatype;typedef struct node{ datatype data; struct node *next;}linklist;linklist *CreatListF() //尾插法创
2014-03-24 17:20:15
631
原创 进制转换
可以在2-8随意转换进制//进制转换#includevoid to(int x,int y);int main(void){ int m,n; printf("enter the number:\n"); while(scanf("%d",&m) == 1) { printf("enter the base 2-10 \n"); scanf("%d",&n);
2014-02-23 16:07:22
576
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人