码迷,mamicode.com
首页 >  
搜索关键字:const 底层const 顶层const    ( 26295个结果
(转载)关于gcd的8题
发现其实有关gcd的题目还是挺多的,这里根据做题顺序写出8题。[bzoj2818: Gcd] gcd(x,y)=质数, 1#include const int MAXN = 10000001;int n, primes;long long prime[MAXN], phi[MAXN];bool co...
分类:其他好文   时间:2014-06-25 22:12:36    阅读次数:317
HAOI2011 problem b
其实就是容斥原理了代码: 1 uses math; 2 const maxn=55000; 3 var i,n,a,b,c,d,w,tot:longint; 4 ans:int64; 5 sum,mu,p:array[0..maxn] of int64; 6 procedure ge...
分类:其他好文   时间:2014-06-25 22:10:01    阅读次数:299
生产者与消费者的一个简单例子
生产者#include#include#includeusing namespace std; int main(void) { ofstream out; const char ch = '*'; long long k = 0; DWORD64 time = GetTickCount64(); ...
分类:其他好文   时间:2014-06-24 11:29:19    阅读次数:354
静态常量整数成员在class内部直接初始化
如果class内含const static integral data member,那么根据C++标准规格,我们可以在class之内直接给予初值。所谓integral泛指所有整数型别,不单只是指int。例如: #include #include #include   using namespace std;   template...
分类:其他好文   时间:2014-06-22 21:07:17    阅读次数:203
C语言之不规则数组和指针
不规则数组是每一行的列数不一样的二维数组。 在了解不规则数组之前,先了解一下用复合字面量创建的二维数组。复合字面量是一种C构造,前面看起来像是类型转换操作,后面跟的是花括号括起来的初始化列表。 (const int) {100} (int[3]) {1,2,3}...
分类:编程语言   时间:2014-06-22 19:40:54    阅读次数:163
C语言 字符串和数字转换函数
atof(将字符串转换成浮点型数) 相关函数 atoi,atol,strtod,strtol,strtoul 表头文件 #include 定义函数 double atof(const char *nptr); 函数说明 atof()会扫描参数nptr字符串,跳过前面的空格字符,直到遇上数...
分类:编程语言   时间:2014-06-22 12:35:18    阅读次数:308
zoj-3792-Romantic Value-最小割+数值转化
如果不需要求边的个数的话,就是一个裸的最小割问题。 求边的个数就用边的权值记录一下。 #include #include #include #include #include using namespace std; #define INF 99999999 #define LL long long const LL maxn =55; const LL maxm =4400; con...
分类:其他好文   时间:2014-06-22 11:15:00    阅读次数:167
STL vector的构造函数和析构函数(2)
public member function std::vector::vector C++98 C++11 default (1) explicit vector (const allocator_type& alloc = allocator_type()); fill (2) explicit vec...
分类:其他好文   时间:2014-06-22 07:02:06    阅读次数:386
指针知识梳理6-const与指针
const 定义的变量为只读变量,在语法层面上通过这个变量去修改内存是不允许的。 但是对于以下代码,就有很多人绕了: const int  *p1;  //p1能变,*p1不能变 int const  *p2;  //p2能变,*p2不能变 int *const  p3;  //p3不能变,*p2能变 我们通过代码来验证说明这三种写法: #include int main()...
分类:其他好文   时间:2014-06-22 06:10:20    阅读次数:201
【C语言天天练(十三)】printf、fprintf、sprintf和snprintf函数
#include int printf(const char *format, ...); int fprintf(FILE *stream, const char *format, ...); int sprintf(char *str, const char *format, ...); int snprintf(char *str, size_t size, const cha...
分类:编程语言   时间:2014-06-21 20:39:48    阅读次数:215
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!