摘要: 类模板 #include "stdafx.h" #include using namespace std; template class A { public: A(double r1,double i1) { r = r1; i = i1; } //simple print(); simple p 阅读全文
posted @ 2019-10-15 11:29 tangjunjun 阅读(101) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include using namespace std; int _tmain(int argc, _TCHAR* argv[]) { int b=1; switch (b+2){ case 1 : { cout<<"b="<<b<<endl;} case 阅读全文
posted @ 2019-10-15 11:28 tangjunjun 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 精确算法(Exact algorithm)指可求出最优解的算法。到目前为止,已提出的精确算法种类较多,有分支定界法、割平面法、整数规划算法和动态规划算法等。一般可用软体为 CPLEX LINGO GUROBI 启发式策略(heuristic)是一类在求解某个具体问题时,在可以接受的时间和空间内能给出 阅读全文
posted @ 2019-10-15 11:28 tangjunjun 阅读(4332) 评论(0) 推荐(0) 编辑
摘要: int b=8; int c=0; c=++b; cout<<"c="<<c<<endl; cout<<"b="<<b<<endl; 结果为:c=9;b=9; int b=8; int c=0; c=b++; cout<<"c="<<c<<endl; cout<<"b="<<b<<endl; 结果为 阅读全文
posted @ 2019-10-15 11:26 tangjunjun 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 指针的一些总结 const与指针 指向const的指针指的是指针指向的数据是常量,不可以被修改,但指针变量本身可以被修改,如const int *p;严格说不能用指针间接修改指向的数据,但该变量可以通过自己本省修改。如 int a=10; const int *p=&a;则*p=9是错误的,无法被修 阅读全文
posted @ 2019-10-15 11:25 tangjunjun 阅读(237) 评论(0) 推荐(0) 编辑
摘要: #include "stdafx.h" #include using namespace std; int _tmain(int argc, _TCHAR* argv[]) { char buffer[134]; cin>>buffer; int len=(int) strlen(buffer);/ 阅读全文
posted @ 2019-10-15 11:25 tangjunjun 阅读(124) 评论(0) 推荐(0) 编辑
摘要: 头文件格式 主要声明,如函数,变量等 源文件说明头文件声明的定义 头文件与源文件总体框架与架构 头文件与源文件总体框架与架构 阅读全文
posted @ 2019-10-15 11:24 tangjunjun 阅读(357) 评论(0) 推荐(0) 编辑
摘要: 变量a会从运行的程序上叠加,因此输出a++的值为9,10,11,12,13,14等 #include "stdafx.h" #include using namespace std; int A(){ static int a=9; //去掉static 程序将会不一样 cout<< a++<<en 阅读全文
posted @ 2019-10-15 11:23 tangjunjun 阅读(798) 评论(0) 推荐(0) 编辑
摘要: 默认参数 即使申明是用的,如function(int a,int b=4);此时就默认变量b的参数为4,调用函数时候可用function(5)。默认参数要在形参尾部。 指针参数 引用参数 函数声明与定义 int function(int &a,int &b){}; 函数调用 int d=5,e=9; 阅读全文
posted @ 2019-10-15 11:23 tangjunjun 阅读(187) 评论(0) 推荐(0) 编辑
摘要: C语言中的回调函数(Callback Function) 1 定义和使用场合 回调函数是指 使用者自己定义一个函数,实现这个函数的程序内容,然后把这个函数(入口地址)作为参数传入别人(或系统)的函数中,由别人(或系统)的函数在运行时来调用的函数。函数是你实现的,但由别人(或系统)的函数在运行时通过参 阅读全文
posted @ 2019-10-15 11:22 tangjunjun 阅读(266) 评论(0) 推荐(0) 编辑
https://rpc.cnblogs.com/metaweblog/tangjunjun