- 博客(13)
- 收藏
- 关注
原创 c++ STL中vector容器集合算法(交集,并集,差集)
set_intersection 交集 set_union 并集 set_difference 差集 #include <iostream> #include <algorithm> #include <vector> using namespace std; class person{ public: string name ; int age; public: person(){ this->name="";
2021-03-27 15:43:42
4106
原创 c++ STL 算法(二)(merge、random_shuffle、reverse、copy、replace、replace_if)
merge 容器合并算法 random_shuffle 随机洗牌算法 reverse 反转算法 copy 复制算法 replace 替换算法 replace_if 条件替换算法 #include <iostream> #include <algorithm> #include <vector> #include <random> #include <time.h> #include <iterator> using namespac
2021-03-26 16:25:35
165
原创 c++STL常用算法(一)(transform、adjacent_find、find_if、count)
#include <iostream> #include<algorithm> using namespace std; class person{ public: string name; int age; person(){ this->name=""; this->age=0; } person(string name ,int age ){ this->name=nam
2021-03-25 16:38:35
172
原创 c++中谓词与适配器
#include <iostream> #include <vector> #include<algorithm> using namespace std; class great_20{ public: bool operator()(int val){ return val>20; } }; bool greater_20(int val){ return val>20; } //一元谓词 void test0
2021-03-24 17:06:09
93
原创 ArcGISEngine学习(1)
ArcGIS Engine 数据加载 1.IMapControl接口 1.1思路简介: (1)使用OpenFileDialog 打开文件对话框,获取打开文件路径。 (2)CheckMxFile(pFileName) 方法检查地图文档是否有效。 (3)LoadMxFile(pFileName) 方法想MapControl控件中加载地图文档。 private void iMapControl接口ToolStripMenuItem_Click(object sender, EventArgs e)
2021-02-01 15:15:37
477
原创 2021.1.19QT标准对话框
#include "mainwindow.h" #include "ui_mainwindow.h" #include<QDir> #include<QFileDialog> #include<QCoreApplication> #include<QColorDialog> #include<QFontDialog> #include<QInputDialog> #include<QMessageBox> #pragma .
2021-01-19 18:34:12
189
原创 c++中的string学习笔记
标准库类型string 使用string需要包含的头文件: int main() { string s1 = "Hello world ";//拷贝初始化 string s2(5, 'M');//直接初始化 string s_end = s1 + s2 ; cout << s_end << endl; cout << s1[0] << "----" << s2[0] << endl; return 0; } Hell
2020-11-08 10:48:03
149
原创 类模板2 坐标相加减
标准类: #include <iostream> using namespace std; //创建类 class mix { public: mix(int a, int b) { this->a = a; this->b = b; } void printmix() { cout << "-------" << '(' << a << ',' << b << ')' << "-
2020-11-06 22:55:39
393
原创 函数模板与类模板template
//模板函数 #include <iostream> using namespace std; template <typename T> void myswap(T& a, T & b) { T temp = a; a = b; b = temp; } template <typename T> class A { public: A(T a) { this->a = a; } void printA() { cout <
2020-11-06 16:53:25
176
原创 Python中的随机数
import numpy as np print(np.random.random())#随机数生成 print(np.random.uniform(10,20))#10-20之间的随机数 print(np.random.randint(10,20))#10-20之间的随机整数 print(np.random.choice(range(10,100,2)))#10-100跨度为2 中随机数 p=[...
2020-04-21 18:16:02
335
原创 Python中图像与矩阵的转换
from PIL import Image #矩阵转图片使用 import matplotlib.image #图片转矩阵使用 #图片转为矩阵 imead img=matplotlib.image.imread("C:\\Users\\Administrator\\Desktop\\2007009.500m_16_days_NDVI.tif") #此处可进行对图像矩阵数据的处理操...
2020-04-21 18:12:52
1848
2
原创 Python与excel数据写入
res=[['字段1','字段2'],[3,4],[5,6],[7,8],[9,10],[11,12],[13,14],[15,16],[17,18],[19,20],[21,22]] #在没有文件的条件下创建文件并写入数据 def write_excel(): book=xlwt.Workbook() sheet=book.add_sheet("第一个表") ...
2020-04-21 18:06:57
169
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人