经常会在项目中用到 int to string
#include
#include
#include
using namespace std;
int main(void)
{
ostringstream num;
num << 123;
string str = num.str();
cout << str << endl;
return 0;
}...
分类:
编程语言 时间:
2014-07-22 23:04:54
阅读次数:
283
char s[maxn];
int sa[maxn];
int t[maxn], t2[maxn], c[maxn];
int rank[maxn], height[maxn];
int n;
void build_sa(int m)
{
int i, *x = t, *y = t2;
for(i = 0; i < m; i++)
c[i] = 0;
for(i = 0; i < n; ...
分类:
其他好文 时间:
2014-07-22 23:04:34
阅读次数:
293
写一个php文件,就是配置数据库的,可以直接把下面的代码复制到一个php文件中,让后改一下数据库的路径以及用户名,密码这段代码就可以使用了。
返回的是json数据
一下为代码,当然了也可以根据这些代码封装成函数,增加其重用性。
<?php
// phpinfo();
//创建数据库连接
$conn = mysql_connect("127.0.0.1","root","root")...
分类:
数据库 时间:
2014-07-22 23:03:34
阅读次数:
302
NC -v IP地址 端口<c:\1.txt具体实例:NC -v 211.157.106.78
8080 <c:\1.txt打开记事本,写一段批处理让nc自动传包 格式:gonc -v 211.157.106.78
8080<c:1.txtgoto go将文件保存为批处理1.bat
分类:
移动开发 时间:
2014-07-22 23:00:53
阅读次数:
343
转自:http://blog.csdn.net/wnczwl369/article/details/7483290转自:http://hi.baidu.com/c2_sun/item/934a542518c6ecc5a5275aadstruts.xml文件配置:
1 2 5 6 7 ...
分类:
其他好文 时间:
2014-07-22 23:00:12
阅读次数:
549
SL:List Dishes
=...;ServiceReference1.Service1Client myClient = new
Service1Client();myClient.MakeOrderAsync(Dishes);WEB:[OperationContract]public
Boo...
分类:
Web程序 时间:
2014-05-01 19:54:53
阅读次数:
590
看Discuss说是博弈论,没学到这个分类。不过仔细想了想,发现。如果m 2 3 int main()
{ 4 int m, n; 5 int i; 6 7 while (scanf("%d %d", &m, &n) != EOF) { 8 if
(m <...
分类:
其他好文 时间:
2014-05-01 19:38:17
阅读次数:
368
/**js Unicode编码转换*/vardecToHex =function(str)
{varres=[];for(vari=0;i < str.length;i++)
res[i]=("00"+str.charCodeAt(i).toString(16)).slice(-4);return"...
分类:
Web程序 时间:
2014-05-01 19:36:51
阅读次数:
427
求矩形和圆是否相交或相切。
#include
#include
#define judge(x,y) x<y||fabs(x-y)<0.00000001
double dis(int x,int y,int a,int b)
{
return (x-a)*(x-a)+(y-b)*(y-b);
}
int main()
{
int T;
scanf(...
分类:
其他好文 时间:
2014-04-30 22:45:38
阅读次数:
365
主定理
主定理最早出现在《算法导论》中,提供了分治方法带来的递归表达式的渐近复杂度分析。
规模为n的问题通过分治,得到a个规模为n/b的问题,每次递归带来的额外计算为c(n^d)
T(n) <= aT(n/b)+c(n^d)
那么就可以得到问题的复杂度为:...
分类:
其他好文 时间:
2014-04-30 22:44:38
阅读次数:
435