Problem:
s0 = "a", s1 = "b", s2 = "ba", s3 = "bab", s4 = "babba", s4 = "babbabab", is called Fibonacci string. For the string with index n, given a string str = "bb", calculate how many times in the...
分类:
其他好文 时间:
2014-08-20 12:31:22
阅读次数:
146
1,vba字符串函数列表:Trim(string) 去掉string左右两端空白Ltrim(string) 去掉string左端空白Rtrim(string) 去掉string右端空白Len(string) 计算string长度Left(string, x) 取str...
分类:
其他好文 时间:
2014-08-20 12:16:22
阅读次数:
210
join()把数组中所有元素转化为字符串并连接起来,并返回该字符串,var arr=[1,2,3];var str=arr.join("#"); //str="1#2#3";如果没有指定分隔符,则默认为逗号var str2=arr.join(); //str2="1,2,3"; reverse...
分类:
Web程序 时间:
2014-08-20 12:09:12
阅读次数:
264
去除尾部多余的字符#include #include int main(int argc, const char *argv[]){ std::string str; char buf[16]; for (int i = 0; i < 10; i++) { int len...
分类:
其他好文 时间:
2014-08-20 10:25:46
阅读次数:
174
Schema.DescribeFieldResultfildResult=Opportunity.StageName.getDescribe();for(Schema.PicklistEntrystr:fildResult.getPicklistValues()){//picklistvalueStringindustry=Str.getValue();}注:会显示出此picklist类型的字段下面的所有的值。如果是有FieldDependencies关系..
分类:
其他好文 时间:
2014-08-20 02:44:56
阅读次数:
202
问题:求字符串中所含有字符的个数(包括空格),即求字符串长度;#include #include int _strlen(const char* str){ assert(str != NULL); int i=0; for(;*str++!='\0';i++); //for(;str++!...
分类:
其他好文 时间:
2014-08-19 22:12:25
阅读次数:
227
#include#include#define N 111char str[N][N];int a,b;int dir[8][2]= {1,1,1,-1,-1,1,-1,-1,0,1,0,-1,1,0,-1,0}; //因为是上下左右和斜对角,所以是八个方向。void fbs(int x,int y...
分类:
其他好文 时间:
2014-08-19 20:39:45
阅读次数:
177
几次面试中遇到都有类似的问题,就是string str = "aa" + "bb" + "ccc";进行了几次内存分配?1 class Program2 {3 static void Main(string[] args)4 {5 st...
分类:
Web程序 时间:
2014-08-19 20:34:45
阅读次数:
196
实用的6位颜色代码生成小程序,适用于标签云中,以下是我最近在做标签云的效果中,生成了随机的颜色效果,在此使用一下:<?php
functionrandomColor(){
$str=‘#‘;
for($i=0;$i<6;$i++){
$randNum=rand(0,15);
switch($randNum){
case10:$randNum=‘A‘;break;
case11:$randN..
分类:
Web程序 时间:
2014-08-19 16:51:05
阅读次数:
205
第三种方法为位运算的方法。位运算符: #include #include #include #include using namespace std;//时间 O(n) 空间 O(1)bool hasSame(string str){ if(str.size() == 0 ) r...
分类:
其他好文 时间:
2014-08-19 12:29:54
阅读次数:
225