自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

小菜鸟的专栏

小硕一枚 关注计算机视觉

  • 博客(22)
  • 资源 (2)
  • 收藏
  • 关注

转载 快速排序

#includeusing namespace std;void quickSort(int a[],int,int);int main(){ int array[]={34,65,12,43,67,5,78,10,3,70},k; int len=sizeof(array)/sizeof(int); cout<<"The orginal arrayare:"<<endl; for

2014-09-26 14:42:25 346

原创 常指针与指向常对象的指针

const int b=5; int c=6; int *sample1=&c; const int*sample2=&b; int *const sample3=&c; const int *const sample4=&b; volatile const int *const sample5=&b; sample1++; //在c的地址值的基础上增加4 *(sample1

2014-09-25 14:23:02 586

原创 宏定义

输出求MAX(A,B,C)#define MAX(A,B,C) ((((A)>(B))?(A):(B))>(C))?(((A)>(B))?(A):(B)):(C)#define MAX(A,B,C) ((A)>(B))?(((A)>(C))?(A):(C)):(((B)>(C))?(B):(C))void main(){ int a=MAX(6,5,6); cout<<a<<end

2014-09-25 10:00:17 375

原创 输入一个整数求每位之和

#include using namespace std;void main(){ int temp; cin>>temp; static int sum=0; while(temp) { int digit=temp%10; sum+=digit; temp/=10; } cout<<sum<<endl;}

2014-09-24 22:58:39 1350

原创 数组名的sizeof 与数组作为函数参数的sizeof

#include using namespace std;//字符串反转int a[]={4,5,6};int sum(int b[],int len){int i,result=0;for(i=0;i<len;i++){result+=b[i];}printf("size of b:%d\n",sizeof(b));return result;}int main(vo

2014-09-24 21:12:26 1161

原创 反转 字符串

void reverseWords(string &s) { string rs; for (int i = s.length()-1; i >= 0; ) { while (i >= 0 && s[i] == ' ') i--; //空格都要过滤 if (i < 0) break; if (!rs.empty()) rs.push_back(' '); //不为空

2014-09-24 20:50:06 344

转载 迭代器的算术操作

除了一次移动迭代器的一个元素的增量操作符外,vector迭代器(其他标准库容器迭代器很少)也支持 其他的算术操作.这些操作称为迭代器算术操作(iterator arithmetic),包括:iter+n    iter-n可以对迭代器对象加上或减去一个整型值.这样做将产生一个新的迭代器,其位置在iter所指元素之前(加法)或之后(减法)n个元素的位置.加或减之后的结果必须指向ite

2014-09-24 11:31:31 1712

转载 编写一个循环将list容器的元素逆序输出

#include#includeusing namespace std; int main(){ int ia[5]={1 , 2 , 3 , 4 , 5}; list lst1(ia , ia + 5); list::iterator iter1 = lst1.begin(), iter2 = lst1.end(); while(it

2014-09-24 11:03:16 682

原创 strlen

char s[]="\\\0923";cout

2014-09-18 22:15:47 367

原创 运算符优先级

int main(){ int a=5,b=3,n=2; int E=(a<b&&n++||(n=n+10)); cout<<E<<endl; cout<<n<<endl; return 0; }输出表达式值为1  n

2014-09-18 21:34:02 351

原创 单个字符串反转

int main() {string str; cout<<"Please input string:"; cin>>str; string::size_type len=str.size();

2014-09-18 19:52:28 370

转载 常对象 常成员函数

1.常对象用const修饰的对象叫对象常量,其格式如下:〈类名〉const 〈对象名〉 或者 const 〈类名〉〈对象名〉声明为常对象的同时必须被初始化,并从此不能改写对象的数据成员。例:分析下列错误的地方,说明理由;#includeclass Point{ int x, y;public:Point(int a, int b) { x=a; y=b;}V

2014-09-17 12:36:22 477

转载 虚函数与虚继承

http://www.cnblogs.com/fanzhidongyzby/archive/2013/01/14/2859064.html

2014-09-17 11:02:30 345

原创 三种继承方式的区别

class parent{public: parent(int var=-1) { m_npub=var; m_nptd=var; m_nprt=var; }public: int m_npub;protected: int m_nptd;private: int m_nprt;};class child1:public parent{public: in

2014-09-17 10:05:18 1109

原创 SQL

有一个学生课程数据库:包括学生表S、课程表C和成绩表SC,它们的结构如下:学生表(S):写出下面的SQL语句:1)查询所有学过数据库的学生的姓名,并按姓名由大到校排序。注:由于重修、补考,一个学生可能有多个考试成绩,查询结果只输出一个。2)查询所修学分超过80的学生,输出学生学好和所修学分。3)给SC表增加代课老师字段Teacher,数据类型

2014-09-16 16:28:44 979

原创 C++ static

int sum(int a){ int c=0;static int b=3;c+=1;b+=2;return(a+b+c);}void main(){int I;int a=2;for(I=0;I<5;I++){printf("%d,", sum(a));}}in

2014-09-16 15:43:18 372

原创 C++ 虚函数

class Base{public: void f1() { printf("Base::f1()\n"); } virtual void f2() { printf("Base::f1()\n"); }};class Drived:public Base{public : void f1() { printf("Drived::f1()\n"); } v

2014-09-16 14:51:41 355

原创 sizeof

http://www.cnblogs.com/lidabo/p/3618345.html

2014-09-13 14:47:33 326

原创 static

void fun(){static int a=6;printf("%d\t",a++);}void main(){ fun(); fun();}输出结果为

2014-09-13 12:47:00 327

原创 公务员 国考资料

http://yun.baidu.com/share/home?uk=1027035554&view=share#category/type=0

2014-09-10 18:17:55 958

原创 数据库入门的好资料

http://www.w3school.com.cn/sql/sql_distinct.asp

2014-09-07 09:21:18 325

原创 纹理分割相关文献

1. Unsupervised Segmentation of Color-Texture Regions in Images ...

2014-09-01 13:30:27 455

python 版本opencv

python 版本opencv 清晰,pdf,包括图像处理,识别等常用方法

2018-06-02

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除