码迷,mamicode.com
首页 >  
搜索关键字:const 常量    ( 36792个结果
cout输出字符串指针
先给出通过字符型指针输出字符串的示例代码,如下:#include using std::cout;using std::endl; int main(){ const char *pszStr = "this is a string"; // 输出字符串 cout int ma...
分类:其他好文   时间:2014-05-14 01:33:08    阅读次数:247
POJ 2478 Farey Sequence 筛选法求欧拉函数
题目来源:POJ 2478 Farey Sequence 题意:输入n 求 phi(2)+phi(3)+phi(4)+...+phi(n) 思路:用类似筛法的方式计算phi(1), phi(2), ..., phi(n) 再求前缀和 #include #include #include //欧拉phi函数 const int maxn = 1000010; typedef long...
分类:其他好文   时间:2014-05-14 01:05:22    阅读次数:323
LoadRunner函数示例:lr_paramarr_random()
lr_paramarr_random()函数的作用为:从一个参数数组中随机抽取一个值并以字符串形式返回。其使用方式及返回方式如下:char * lr_paramarr_random( const char * paramArrayName);该函数在某些测试场景下或许比较有用,如随机选择页面中一.....
分类:其他好文   时间:2014-05-13 22:55:18    阅读次数:505
poj 1423 Big Number
1 /** 2 斯特林(Stirling)公式: 3 4 求 n! 的位数 5 6 ceil函数的作用是求不小于给定实数的最小整数。 7 **/ 8 #include 9 #include 10 #include 11 using namespace std;12 const doubl...
分类:其他好文   时间:2014-05-13 22:06:51    阅读次数:253
unix环境编程 目录操作
1、目录操作有 mkdir(constchar *pathname,mode_t mode) 创建目录,成功则返回0,若出错则返回-1 int rmdir(const char *pathname) rmdir可以删除一个空目录,成功则返回0,若出错返回-1 DIR *opendir(const *pathname) 成功则返回指针,若出错则返回NULL...
分类:其他好文   时间:2014-05-13 08:06:02    阅读次数:298
HDU 4022 Bombing STL 模拟题
手动模拟。。 #include #include #include #include #include #include #include #include using namespace std; #define N 10100 #define inf 1000000010 mapx,y; struct X{ int x,y; bool operator<(const X&a)const{...
分类:其他好文   时间:2014-05-13 07:29:10    阅读次数:294
字符串/数字之间类型转换总结
1、char向int转换 方法一:(适用于单个字符) char ch = '6'; int num = ch - '0';   //此时num=6 方法二:(适用于字符串) 函数atoi: int atoi ( const char * str ); 参数是一个char类型的数组,不能是单个char变量 char str[10] = "32352"; int num = atoi(...
分类:其他好文   时间:2014-05-13 06:55:14    阅读次数:362
关联容器 — hash_set
容器hash_set是以hash table为底层机制的,几乎所有的操作都是转调用hash table提供的接口。由于插入无法存储相同的键值,所以hash_set的插入操作全部都使用hash table的insert_unique接口,代码如下: pair insert(const value_type& obj) { pair p = rep.insert_unique(obj); ...
分类:其他好文   时间:2014-05-13 06:33:44    阅读次数:303
POJ 1006 Biorhythms 中国剩余定理
题目来源:POJ 1006 Biorhythms 题意:给出3个周期第一次发生的时间 和 当前开始的天数 求三个周期下一次到达高峰期发生在哪一天 思路:这题很水 试一下我的模版而已 #include #include using namespace std; typedef long long LL; const int maxn = 10; int a[maxn], m[maxn]; ...
分类:其他好文   时间:2014-05-13 05:07:28    阅读次数:253
Delphi Inputbox 输入时显示‘*’
unit Unit1;interfaceusesWindows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,Dialogs, StdCtrls;const InputboxMessage = WM_USER + ...
分类:其他好文   时间:2014-05-12 19:20:32    阅读次数:314
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!