#include
#include
using namespace std;
class Person{
string name;
bool gender;
int age;
Person *lover;
public:
Person(const char *n="无名",bool g=true);
void growup(int years);
void s...
分类:
编程语言 时间:
2015-04-14 11:22:46
阅读次数:
177
处理字符串的难点是字符串的索引和创建字符串等其他的问题以及如何创建一个字符串的子串。
字符串是由Unicode组成的,你不要把Unicode组成的字符串的子串看做Unicode字符,而是把它们拆分成Unicode字素,所以我们不能像数组中那样索引,因为会遇到有的字素是由多个字符组成,这样会把一个完整语义的字素拆成了两个字符从而改变了原意。所以字符串是由另外的一个类型来索引的,这种类型就是...
分类:
移动开发 时间:
2015-04-14 11:21:50
阅读次数:
137
给出n,m
n个数字
m次询问,每次询问(l,r)区间的第k小的数
划分树模板 mark一下
#include "stdio.h"
#include "string.h"
#include "algorithm"
using namespace std;
int a[100010],as[100010];
int tree[20][100010];// 记录第i层元素序列
i...
分类:
其他好文 时间:
2015-04-14 11:19:38
阅读次数:
120
我们都知道在Swift诞生之前进行IOS开发一直使用Objective-c这门语言。OC和Swift之间需要一个桥接。
IOS中的API基本都是在许多年前由OC写成的,现在在Swift中也可以用,甚至你都看不出区别,非常自然。有一些特殊的类型,在交接两种语言的时候需要注意,这使得使用OC调用IOS的API的时候会比Swift容易很多。
首先是NSString,这是String以前的形式...
分类:
移动开发 时间:
2015-04-14 11:16:10
阅读次数:
109
1、左移(>>)
符号位一起参加移位
对于int型,最大的移位数是31,当>=32时,对32取模然后移位;
对于long型,最大的移位数是62,当>=64时,对64取模然后移位;
观察一段代码:
import java.util.*;
public class Test{
public static void main(String[] args){...
分类:
其他好文 时间:
2015-04-14 11:14:58
阅读次数:
120
实现字符串strstr()的功能,即从母串中查找子串第一次出现的位置(序号),没有出现则返回-1.【思路】刚开始学c时就学到过这个例子。不同之处在于,这里参数是string,处理起来要比char*简单。【my code】int strStr(string haystack, string needl...
分类:
其他好文 时间:
2015-04-14 09:51:37
阅读次数:
121
public static string genRptUrl(string strRptServer, string strRptPath, string strRptName, ParameterValue[] parameters, string type) { ...
分类:
Web程序 时间:
2015-04-14 09:50:09
阅读次数:
178
HttpUtility.HtmlEncode(string) 可以对传入的string进行处理,避免被注入js代码或者html标记。
分类:
Web程序 时间:
2015-04-14 09:47:17
阅读次数:
142
转载自 http://www.cnblogs.com/xFreedom/archive/2011/05/16/2048037.html标准C++中的string类的用法总结相信使用过MFC编程的朋友对CString这个类的印象应该非常深刻吧?的 确,MFC中的CString类使用起来真的非常的方便好...
分类:
编程语言 时间:
2015-04-14 08:26:43
阅读次数:
156
publicstaticvoidmain(String[]args)throwsIOException{ BASE64Encoderencoder=newBASE64Encoder(); System.out.println("Pleaseinputusername:"); Stringusername=newBufferedReader(newInputStreamReader(System.in)).readLine(); System.out.println(encoder.encode(us..
分类:
Web程序 时间:
2015-04-14 07:23:16
阅读次数:
137