1 #include 2 #include 3 using namespace std; 4 int main(){ 5 string s; 6 char tmp; 7 getline(cin,s); 8 for(int i=0;i<s.length()/2;i++...
分类:
其他好文 时间:
2014-07-07 12:51:30
阅读次数:
199
1 #include 2 #include 3 using namespace std; 4 int main(){ 5 string s; 6 int i,c=0; 7 getline(cin,s); 8 for(i=1;i<s.length()-1;i++) 9...
分类:
其他好文 时间:
2014-07-07 10:41:07
阅读次数:
181
题目:Given a sorted array, remove the duplicates in place such that each element appear onlyonceand return the new length.Do not allocate extra space fo...
分类:
其他好文 时间:
2014-07-03 20:58:08
阅读次数:
248
Given an unsorted array of integers, find the length of the longest consecutive elements sequence.For example,Given[100, 4, 200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2014-07-03 19:24:36
阅读次数:
142
函数: 1、从左开始截取字符串 left(str, length) 说明:left(被截取字段,截取长度) 例:select left(content,200) as abstract from my_content_t 2、从右开始截取字符串 right(str, length) 说明:right...
分类:
数据库 时间:
2014-07-03 09:58:51
阅读次数:
238
2014-7-1 应用在某门户应用排序管理页面function OnTextChanged() {var inputText = $.trim($("#txtLocateAllSeller").val());if (inputText.length != 0) {var el = $('.appli...
分类:
Web程序 时间:
2014-07-03 00:04:43
阅读次数:
266
日常遇到的错误针对ie6 所以要用代码包起来在ie7下 会报错 例如和$(document).ready(function(e) { var ulwidth = $("div.gundong ul li").length * 180; $("div.gundong ul").width(ulwi.....
分类:
其他好文 时间:
2014-07-02 21:38:50
阅读次数:
187
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without
repeating letters for "abcabcbb" is "abc", which the length is 3. Fo...
分类:
其他好文 时间:
2014-07-02 16:35:32
阅读次数:
213
Pick-up sticks
Problem Description
Stan has n sticks of various length. He throws them one at a time on the floor in a random way. After finishing throwing, Stan tries to find the top sticks,...
分类:
其他好文 时间:
2014-07-02 15:29:53
阅读次数:
295
(一)二分的模版:
int binary_search(int *array, int length, int key) {
int start = 0, end = length - 1;
while(end >= start) {
int middle = start + (end - start) / 2;
int tmp = array[middle];
if(tmp <...
分类:
其他好文 时间:
2014-07-02 08:19:05
阅读次数:
211