码迷,mamicode.com
首页 >  
搜索关键字:namespace    ( 41927个结果
【OpenCV】复制、切割出图像ROI区域
举例: #include #include using namespace cv; // 从一幅大图像中,取出一小块图像。 int main() { /* 读取大图像 */ IplImage *img1 = cvLoadImage("C:\\Users\\Liu\\Desktop\\a2.bmp", -1); cvNamedWindow("Cut", CV_WINDOW_AUTOSIZ...
分类:其他好文   时间:2015-04-15 13:32:10    阅读次数:219
项目3-人数不定的工资类
【项目3-人数不定的工资类】 设计一个工资类(Salary),其中的数据成员包括职工人数(number,人数不定)和number个职工的工资salary,要求输入职工工资并逐个输出。 提示:用固定大小的数组存储number个职工的工资,可能造成空间的浪费,也可能会由于空间不够而不能处理职工人数过多的应用。将salary声明为指针类型的成员,通过动态分配空间,分配正好大小的空间存储数据。 ...
分类:其他好文   时间:2015-04-15 11:32:25    阅读次数:134
c++快速排序(以最右值为元点)
#include using namespace std; void swap(int *a,int *b) { int temp = *a; *a = *b; *b = temp; } void Grial(int a[],int x,int y) { int i=x-1; int j=x; int key = a[y]; if(x>=y)return ; while(j<y...
分类:编程语言   时间:2015-04-15 11:27:18    阅读次数:192
每日一题22:Deque与Trait
虽然之前写过一个Deque,但是那个属于C与C++混合的产品,近来在学习C++模板,所以写了一个C++版,同时第一次尝试使用Trait技术。 本来已经写好的文章,发表之后丢失了,好郁闷,没心情再写了,贴贴代码吧。这个Trait是用来决定传递参数时是使用值传递还是引用传递#ifndef _TYPE_TRAITS_H_ #define _TYPE_TRAITS_H_namespace MyDataSt...
分类:其他好文   时间:2015-04-15 11:23:15    阅读次数:159
C++快速排序(以中间元素为元点)
#include using namespace std; void Grial(int a[],int x,int y) { if(x>=y)return ; int i=x; int j=y; int temp; int key=a[(i+j)/2]; while(i<j) { while(a[i]k...
分类:编程语言   时间:2015-04-15 11:19:48    阅读次数:121
leetcode Valid Parentheses
代码: 1 #include 2 #include 3 #include 4 5 using namespace std; 6 7 bool isValid(string s) { 8 map smap; 9 smap.insert(make_pair('(', ')'));10...
分类:其他好文   时间:2015-04-15 11:19:22    阅读次数:159
数据结构 - 树(基础)
1、无根树转有根树 #include #include #include #include #define LL long long #define INF 0x7fffffff #include using namespace std; const int maxn = 1000005; int p[maxn]; int n; int root; vector G[maxn]; ...
分类:其他好文   时间:2015-04-15 09:44:26    阅读次数:156
PKU 3468 A Simple Problem with Integers
线段树区间求和...
分类:其他好文   时间:2015-04-15 09:43:53    阅读次数:150
hdu 2647 Reward
逆拓扑排序,开始死活a不掉,后来才发现自己记录工资的方法是有问题的.....失策失策啊 #include #include #include #include #define maxn 10000+100 using namespace std; vector >mapp; int head[maxn]; int money[maxn]; int n,m; void topo() { int...
分类:其他好文   时间:2015-04-15 09:43:42    阅读次数:136
C++ 实现判断一个输入日期是星期几,是一年中的第几天
/* 通过输入年月日,计算出这一天是星期几,计算这一天是这一年的多少天,判断这一年是否为闰年 */ #include using namespace std; struct time { int year; int month; int day; unsigned int weekday; }; void initialtime(time & t);//输入初始化时...
分类:编程语言   时间:2015-04-15 09:42:13    阅读次数:293
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!