码迷,mamicode.com
首页 >  
搜索关键字:using password: yes    ( 53562个结果
九度 1214
#include #include #include using namespace std; #ifdef ONLINE_JUDGE #define FINPUT(file) 0 #define FOUTPUT(file) 0 #else ...
分类:其他好文   时间:2014-05-14 00:18:31    阅读次数:367
Codeforces 429D Tricky Function 最近点对
题目链接:点击打开链接 暴力出奇迹。 正解应该是最近点对,以i点为x轴,sum[i](前缀和)为y轴,求任意两点间的距离。 先来个科学的暴力代码: #include #include #include #include #include #include using namespace std; #define N 100050 #define ll __int64 ll a[N], su...
分类:其他好文   时间:2014-05-13 05:45:30    阅读次数:283
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
指向指针的指针
理解二级指针,关键是理解指针的存储方式和意义。 这里以指向int型指针的指针为例,梳理一下二级指针在内存分配中 的奥妙.... #include using namespace std; int main() { int a[5] = {1, 2, 3, 4, 5}; int *p = a; int **point = &p; cout << "a = "...
分类:其他好文   时间:2014-05-12 23:22:28    阅读次数:291
C++类的继承实例
首先由三个类分别为DateType(日期类)、TimeType(时间类)、DateTimeType(日期时间内)。具体代码如下: #include using namespace std; class DateType { int year,month,day; public: DateType(int year = 2000,int month = 12,int day = 1) {...
分类:编程语言   时间:2014-05-12 23:03:54    阅读次数:430
矩阵求和--重载运算符
#include //using namespace std; class Matrix { public:     Matrix();     friend Matrix operator+(Matrix &,Matrix &);     friend ostream& operator     friend istream& operator>>(istream&,Matri...
分类:其他好文   时间:2014-05-12 22:39:15    阅读次数:387
排序算法——直接插入排序
直接插入排序是一种实现较为简单的排序算法。基本的思想是,从数组的第二个元素起,每次选取一个元素,与前面已经排序数组的元素比较,找到该元素的合适位置。不多说,直接上代码。#include #include #include using namespace std;const int arrSize =...
分类:其他好文   时间:2014-05-12 20:59:47    阅读次数:295
第二章 做一个简短的C++程序
第二章 做一个简短的C++程序2. 输出语句的使用endl要调用flush函数刷新缓冲区,而\n不需要调用4.iostream与iostream.h的区别5. 重名问题释放命名空间的两种方法(1.所有 2局部)using namespace std; using std::endl;例: 1 //#...
分类:编程语言   时间:2014-05-12 20:40:32    阅读次数:313
编写一个宏,实现判断数组a元素的个数
#include using namespace std;#define TestArrayLengthA(A) sizeof(A)/sizeof(*A)#define TestArrayLengthB(B) sizeof(B)/sizeof(B[0])//这样测出的是数组可以放多少个元素,比如Ar...
分类:其他好文   时间:2014-05-12 19:46:09    阅读次数:374
简单的通配符匹配算法
个人的小程序需要匹配一些简单的通配符,如*?之类。抽时间写了一个 1 #pragma once 2 #ifndef CHECKER 3 #define CHECKER 4 5 #include 6 #include 7 #include 8 using namespace s...
分类:其他好文   时间:2014-05-12 19:29:51    阅读次数:386
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!