码迷,mamicode.com
首页 >  
搜索关键字:length    ( 19575个结果
字符串-04. 字符串逆序(15)
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
循环-06. 统计一行文本的单词个数(15)
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
leetcode 题解:Remove Duplicates from Sorted Array(已排序数组去重)
题目: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
LeetCode:Longest Consecutive Sequence
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
mysql字段截取(转)
函数: 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
js 根据输入框内容自动定位listbox选项
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
LeetCode——Longest Substring Without Repeating Characters
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
计算几何-hdoj-1147-Pick-up sticks
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
ACM:二分查找,以及利用二分法来找上下界
(一)二分的模版: 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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!