#-*-coding:utf-8-*- ''' 写函数,判断用户传入的对象(str,列表,元组)的每一个元素是否有为空,并返回 ''' def func(x): '''str''' if type(x) is str and x: for i in x: if i == ' ': return Tr... ...
分类:
编程语言 时间:
2019-01-12 00:13:06
阅读次数:
276
把代码过程经常用到的代码收藏起来,如下的代码内容是关于C#读取文本文件的2个函数的代码。Textreadertr=newStreamReader("date.txt");Console.WriteLine(tr.ReadLine());tr.Close();StreamReaderreader=newStreamReader("date.txt");Cons
#include using namespace std; const int N=1e6+10; char s[N]; int n,tot,tr[N][30],fail[N],end[N]; void insert(){ int len=strlen(s+1),now=0; for(int i=1... ...
分类:
其他好文 时间:
2019-01-10 22:22:03
阅读次数:
171
#include using namespace std; const int N=2e4+10; int n,tot,tr[N][30],fail[N],end[N]; string s[200];char m[1000010]; struct node{int pos,num;}ans[N]; ... ...
分类:
其他好文 时间:
2019-01-10 22:21:46
阅读次数:
155
HashSet:(去重原理:hashCode,equals)哈希表实现,数据无序;不同步;元素可以为null,但最多只能有一个;当向HashSet中存入一个元素时,HashSet会调用该对象的hashCode方法来得到该对象的hash值,然后根据hash值决定该对象在HashSet中的存储位置。Tr ...
分类:
其他好文 时间:
2019-01-09 23:36:29
阅读次数:
325
添加事件监听(DOM2) element.addEventListener(type, callback[, useCapture]) -- type:事件类型字符串 -- callback:回调函数,事件处理程序 -- useCapture:可选参数,是否使用事件捕获的方式处理事件,如果传递 tr ...
分类:
其他好文 时间:
2019-01-08 21:17:47
阅读次数:
184
说明: 1、把数据库中的数据查询出来,填充到前台的table中,注意 从数据查询出来的 属性IsNew="0"(table 行tr的属性) 2、单击“添加”按钮 新添加行追加到table的尾部 属性IsNew="1"(table 行tr的属性) 3、也可以删除新添加的行 一、前端代 二、后台代码 ...
分类:
其他好文 时间:
2019-01-08 19:22:19
阅读次数:
158
1、计算1~100的数之和 for循环实现1~100的和 sum1 = 0 for i in range(1,101): sum1 = sum1 + i i += 1 print(f"1-100之间的和是:{sum1}") while实现1~100的和 sum1 = 0 i = 1 while Tr ...
分类:
编程语言 时间:
2019-01-07 22:40:49
阅读次数:
255
<table> 标签定义 HTML 表格<tr> 元素定义表格行,<th> 元素定义表头,<td> 元素定义表格单元。<table><tr><td><th>标签运用写出简单表格<body> <table border="1px" style="width: auto;"><!--设宽高值和边框--> ...
分类:
其他好文 时间:
2019-01-05 16:38:00
阅读次数:
205