![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C/C++
cswwp
这个作者很懒,什么都没留下…
展开
-
关于C++的IO流
#include using namespace std; int main() { int num; while(cin>>num,!cin.eof()) { if(cin.bad()) throw runtime_error("IO s原创 2014-02-22 18:41:06 · 656 阅读 · 0 评论 -
496. Next Greater Element I
You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1's elements in the corresponding places of nums原创 2017-02-08 22:06:06 · 1086 阅读 · 0 评论 -
455. Assign Cookies
Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size of a c原创 2017-02-07 23:06:56 · 264 阅读 · 0 评论 -
500. Keyboard Row
问题描述:Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Example 1: Input: ["Hello", "Alaska"原创 2017-02-07 22:30:55 · 2385 阅读 · 0 评论 -
单链表,双向循环链表应用
//1单链表得简单那应用#include #include using namespace std; #define false 0; #define true 1; typedef struct ElemType{ char name[30]; char mobile[30]; char addr[30]; }ElemType; typedef struct LNode{原创 2015-01-06 21:30:31 · 789 阅读 · 0 评论 -
CString 源码
CString使用的是引用技术,可以共享数据(这个大家都知道),另外空的CStirng是指向一个固定的地址的(_afxInitData). 另外CStirng是有长度限制的2147483647(无符号int 的最大值). 数据格式 struct CStringData { long nRefs; //引用记数 int nDataLength; //字符使用长度 int nAllocL转载 2014-05-07 15:30:33 · 644 阅读 · 0 评论 -
三元组表示矩阵,以及稀疏矩阵的转置
//希望大家提出意见,共同学习。 #include #include using namespace std; #define MAXSIZE 100 typedef struct{ int row,col;//非0元素的位置坐标。 int key;//非0元素的键值。 }Triple; typedef struct{ Triple data[MAXSIZE];//非原创 2013-05-13 20:09:51 · 1624 阅读 · 0 评论 -
线程同步方法及注意事项vc++
一,利用互斥mutex进行线程间同步。 二,利用事件线程间同步 1人工重置的事件对象 当它变为有信号状态的时候,所有的线程都可以运行 在一个线程得到该事件状态后不会将改时间设置为非信号状态,除非人工设置ResetEvent() 函数 2自动重置的事件对象 当它变为有信号状态的时候,所有等待该事件的线程只能有一个变为可调度的线程去运行。 调用WaitForSingleObj原创 2014-03-25 22:33:21 · 700 阅读 · 0 评论 -
CString
首先理清一下CString的基本概念 CString就是对一个用来存放字符串的缓冲区和对施加于这个字符串的操作封装。也就是说,CString里需要有一个用来存放字符串的缓冲区,并且有一个指针指向该缓冲区,该指针就是LPTSTR m_pchData。但是有些字符串操作会增建或减少字符串的长度,因此为了减少频繁的申请内存或者释放内存,CString会先申请一个大的内存块用来存放字符串。这样,以后转载 2014-03-20 14:20:03 · 528 阅读 · 0 评论 -
分类器是如何做检测的?——CascadeClassifier中的detectMultiScale函数解读
【转】分类器是如何做检测的?——CascadeClassifier中的detectMultiScale函数解读 2013-6-27阅读1261 评论0 转载注明出处即可。 在进入detectMultiScal函数之前,首先需要对CascadeClassifier做初始化。 1. 初始化——read函数 CascadeClassifier的初始化很简单: cv::Casc转载 2014-02-25 20:53:29 · 1297 阅读 · 0 评论 -
447. Number of Boomerangs
问题描述: Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between iand j equals the distance between i and k (the原创 2017-03-01 21:51:36 · 395 阅读 · 0 评论